fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. long long a, b, c, k, x, i, d[1005][1005], j, m, n, pfs[1000001], y=0, LmAo;
  4. string s, s1;
  5. map<long long, long long>dem;
  6. int dec2bin(long long k) {
  7. int s=0;
  8. while (k>0){
  9. if (k%2==0)
  10. s++;
  11. k/=2;
  12. }
  13. return s;
  14. }
  15. int main () {
  16. ios_base::sync_with_stdio(false);
  17. cin.tie(0);
  18. cout.tie(0);
  19. cin>>c;
  20. for(x=1; x<=c; x++){
  21. cin>>b;
  22. cout<<"Case #"<<x<<": "<<(long long)(pow(2, dec2bin(b)))<<"\n";
  23. }
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
Standard output is empty