标签:
Problem Description
#include <iostream>
#include<string.h>
using namespace std;
int bn[16];
int main()
{
int n = 0;
while(cin >> n){
memset(bn,0,sizeof(bn));
int i = 0;
bn[i] = n % 2;
n = n/2;
while(n){
i++;
bn[i] = n%2;
n = n/2;
}
for(int j = i;j >= 0;j --){
cout << bn[j];
}
cout << endl;
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/2016zhanggang/p/5484982.html