Advertisement
erfanul007

Light OJ 1182

Dec 31st, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. long long int t,i,a,cnt;
  6. scanf("%lld",&t);
  7. for(i=1;i<=t;i++){
  8. scanf("%lld",&a);
  9. printf("Case %lld: ",i);
  10. cnt=0;
  11. while(a!=0){
  12. if(a%2==1)
  13. cnt++;
  14. a/=2;
  15. }
  16. if(cnt%2==0)
  17. printf("even\n");
  18. else
  19. printf("odd\n");
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement