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