HDU 4349

View Code
 1 #include<iostream>
 2 #include<cstdio>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     int n;
 8     while (scanf("%d",&n) != EOF) {
 9          int cnt(0);
10          while (n) {
11                cnt += (n&1);
12                n >>= 1;      
13          }     
14          printf("%d\n",(1<<cnt));
15     }
16     return 0;
17 }
posted on 2012-08-09 19:12  Dev-T  阅读(180)  评论(0编辑  收藏  举报