Problem Description
Give you a number on base ten,you should output it on base two.(0 < n < 1000)
Input
For each case there is a postive number n on base ten, end of file.
Output
For each case output a number on base two.
Sample Input
1 2 3
Sample Output
1 10 11
#include <cstdio>
int main()
{
int n, i, ans[];
while(~scanf("%d",&n))
{
if(n==)
{
printf("0\n");
}
for(i=;n;i++)
{
ans[i]=n%;
n=n/;
}
for(i--;i>=;i--)
{
printf("%d",ans[i]);
}
printf("\n");
}
return ;
}