题解 | #牛牛的10类人#
牛牛的10类人
https://www.nowcoder.com/practice/232b7fc32fac4636819e31a7d7c960a3
#include <stdio.h> int main() { int n,m; int i; int count=0,sum=0; scanf("%d",&n); for(i=0;i<n;i++) { count=0; sum=0; scanf("%d",&m); while(m>0) { if(m&1) count++; else sum++; m=m>>1; } if(count%2==0&&sum%2!=0) printf("1 "); else if(count%2!=0&&sum%2==0) printf("0 "); else if(count%2!=0&&sum%2!=0) printf("100 "); else printf("10 "); } return 0; }