标签:int div std printf php cond print dia ios
http://acm.xidian.edu.cn/problem.php?id=1169
不断除以2,知道奇数,操作次数的奇偶性。
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; int f(long long x) { if(x&1) return 0; else return f(x/2)^1; } int main() { int T; scanf("%d",&T); while(T--) { long long x; scanf("%d",&x); if(f(x) == 0) printf("First Box\n"); else printf("Second Box\n"); } }
标签:int div std printf php cond print dia ios
原文地址:http://www.cnblogs.com/zhurb/p/6041295.html