#17559: 為什麼這樣不行啊???


fxxx0981940138@gmail.com (夾腳拖)


#include <stdio.h>
int main()
{
int a,b;
while( scanf("%d",&a) != EOF)
{
b=a;
while(a>0)
{
b=b%2;
printf("%d",b);
a=a/2;
}
}
return 0;
}
#17560: Re:為什麼這樣不行啊???


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)


#include
int main()
{
int a,b;
while( scanf("%d",&a) != EOF)
{
b=a;
while(a>0)
{
b=b%2;
printf("%d",b);
a=a/2;
}
}
return 0;
}

印的應該會是反的

要存下來再從後面印到前面