#include<stdio.h> //将任意10进制整数转化为2-16任意进制 int main() { char ku[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int zh[32],i=0,w,j; long int b,y; printf("请输入一个十进制数,我能帮您把它转换成2~16任意进制数:\n"); scanf("%d",&y); b=【1】; printf("请输入要转换为的进制:"); scanf("%d",&w); printf("\n"); do { zh[i]=【1】; 【1】; y=【1】; } while(【1】); printf("把十进制的%ld转换为%d进制:",b,w); for(i--;i>=0;i--) { j=zh[i]; printf("%c",【1】); } printf("\n"); return 0; }
#include<stdio.h> //将任意10进制整数转化为2-16任意进制 int main() { char ku[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int zh[32],i=0,w,j; long int b,y; printf("请输入一个十进制数,我能帮您把它转换成2~16任意进制数:\n"); scanf("%d",&y); b=y; printf("请输入要转换为的进制:"); scanf("%d",&w); printf("\n"); do { zh[i]=y%w; i++; y=y/w; } while(y!=0); printf("把十进制的%ld转换为%d进制:",b,w); for(i--;i>=0;i--) { j=zh[i]; printf("%c",ku[j]); } printf("\n"); return 0; }
标签:10,zh,进制,16,int,printf,填空,任意 From: https://www.cnblogs.com/xkdn/p/17103147.html