http://acm.nefu.edu.cn/JudgeOnline/problemshow.php
用二进制想:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n,k;
while(cin>>n>>k)
{
if((n&k)==k)//注意对n&k加括号啊!!!
puts("ODD");
else
puts("EVEN");
}
return 0;
}
时间: 2024-10-29 12:06:27