判断奇偶数 题解

题目在主页,如有出错请指出

include <bits/stdc++.h>

using namespace std;

int main()
{
string s;
cin >> s;
int len = s.size();
int n = s[len - 1] - '0';
if (n % 2 != 0)
cout << "odd" << endl;
else
cout << "even" << endl;
return 0;
}

posted @ 2025-05-10 10:28  嵇若凌  阅读(11)  评论(0)    收藏  举报