
求一个C语言的程序填空,请大神指教
将十进制整数转换成n进制。main(){inti=0,base,n,____,num[20];printf("Enterdatathatwillbeconverted\n...
将十进制整数转换成n进制。
main( )
{inti=0,base,n,____,num[20];
printf("Enterdatathatwillbeconverted\n");
scanf( "%d",&n)
printf("Enterbase \n");
scanf( "%d",&base);
do
{i++;num[i]=_________;
n=_________;
}while(n!=0);
printf("The data %d has been converted into the %d——base data:\n",n,base);
for (__________)
printf("%d",num[j]);
} 展开
main( )
{inti=0,base,n,____,num[20];
printf("Enterdatathatwillbeconverted\n");
scanf( "%d",&n)
printf("Enterbase \n");
scanf( "%d",&base);
do
{i++;num[i]=_________;
n=_________;
}while(n!=0);
printf("The data %d has been converted into the %d——base data:\n",n,base);
for (__________)
printf("%d",num[j]);
} 展开
1个回答
展开全部
main( )
{inti=0,base,n, j ,num[20];
printf("Enterdatathatwillbeconverted\n");
scanf( "%d",&n)
printf("Enterbase \n");
scanf( "%d",&base);
do
{i++;num[i]= n%base;
n= n/base ;
}while(n!=0);
printf("The data %d has been converted into the %d——base data:\n",n,base);
for (j=i;j>0;j--)
printf("%d",num[j]);
}
{inti=0,base,n, j ,num[20];
printf("Enterdatathatwillbeconverted\n");
scanf( "%d",&n)
printf("Enterbase \n");
scanf( "%d",&base);
do
{i++;num[i]= n%base;
n= n/base ;
}while(n!=0);
printf("The data %d has been converted into the %d——base data:\n",n,base);
for (j=i;j>0;j--)
printf("%d",num[j]);
}
更多追问追答
追问
报错阿大神.. 不能运行..
追答
报什么错?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |