标签:
#include<iostream> using namespace std; int main() { int n; int b[11]; while (cin >> n) { if (n == 0) { cout << "0" << endl; continue; } int k = 0; while(n) { b[k++] = n % 2; n /= 2; } for (int i = k - 1; i >= 0; i--) cout << b[i]; cout << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/lyf-acm/p/5461655.html