#include
#include
int main()
{
int shu,shang,i,yushu;
int a[16]={0};
clrscr();
printf("shu ru yi ge shu shi jin zhi\n ");
scanf("%d",shu);
for(i=0;i
{
yushu=shu%2;
shang=shu/2;
a[i]=yushu;
shu=shang;
}
for(i=15;i>=0;i--)
{
printf("%d",a[i]);
if(i%4==0)
{
printf(" ");
}
}
return 0;
}
頭文件怎麼沒有?
還有輸入的時候應該是 scanf("%d",&shu)才對