1011 HDU4349 Xiao Ming's Hope

代码:

 1 #include <iostream>
 2 #include <cstring>
 3 #include <cstdio>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n;
 9     while(~scanf("%d",&n))
10     {
11         int num=1;
12         while(n>0)
13         {
14             if(n&1)
15                 num*=2;
16             n/=2;
17         }
18         printf("%d\n",num);
19     }
20     return 0;
21 }
22

相关文章:

  • 2021-10-14
  • 2021-10-19
猜你喜欢
  • 2022-02-12
  • 2022-01-06
  • 2021-10-14
  • 2021-08-04
  • 2021-10-23
  • 2021-07-26
相关资源
相似解决方案