已AC代码:
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int i;
while((scanf("%d", &i)) != EOF)
{
string s;
if(i==0)
cout << "0" << endl;
else
{
while(i)
{
char a ;
a = i%2+48;
s = a + s;
i /= 2;
}
cout << s << endl;
}
}
return 0;
}