C++ hdoj 2051Bitset
2016-09-13 22:10
148 查看
#include<iostream> using namespace std; int main() { int i,j,n,a[100]; while(cin>>n) { i=0; while(n) { a[i]=n%2; n=n/2; i++; } for(j=i-1;j>=0;j--) { cout<<a[j]; } cout<<endl; } return 0; }
相关文章推荐
- HDOJ 2736 Surprising Strings——c++STL(map)
- hdoj 1596(floyd)(c++过啦)
- hdoj 2036 改革春风吹满地 C++
- C++ hdoj 2042 不容易系列二
- C++ hdoj 2010 水仙花数
- C++ hdoj 2039 三角形
- hdoj 2042 不容易系列之二 C++
- HDOJ 1236 with three methods using C++
- C++ hdoj 2013
- HDOJ 1022 Train Problem I (C++)
- hdoj 2028 Lowest Common Multiple Plus C++
- hdoj 2033 ( 人见人爱A+B ) C++
- hdoj 2035 A^B C++
- hdoj 2030 汉字统计 (汉字机内码特点) C++
- HDOJ 1170 Balloon Comes!C++版
- HDOJ 1000 A + B Problem C++解法
- hdoj 2027 统计元音 C++
- hdoj 2044 一只小蜜蜂... C++
- C++ hdoj 2008 数值统计
- C++ hdoj 2011 多项式求和