这题只能用位运算,用a%2就不能过
查看原帖
这题只能用位运算,用a%2就不能过
548059
VastUniverse_Hory楼主2022/9/24 14:57

这题只能用位运算,用a%2就不能过。

#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int a;
    cin >> a;
    if (a & 1)
    	cout << "odd" << endl;
    else
    	cout << "even" << endl;
    return 0;
}
2022/9/24 14:57
加载中...