#include
int deTobi(int a)
{
int i = 0, stack[10], r, s;
do{
r = a/2;
s = a%2;
stack[i] = s;
if(r != 0)
{
i++;
a = r;
}
}
while(r);
for(;i>=0; i--)
printf("%d",stack[i]);
printf("\n");
}
int main(void)
{
int a;
printf("Please input a Decimal digit\n");
scanf("%d", &a);
deTobi(a);
return 0;
}
留言