#include
#include
void main(){int n=0,m=0,i=0;
char tmp[1000]={'\0'};
printf("请输入一个十进制数:");
scanf("%d",&n);
printf("转换成n进制数[2/8/16...]:");
scanf("%d",&m);while(n>0){if(n%m < 10)
tmp[i++] = n%m+'0';
else if(n%m>9 && n%m<26)
tmp[i++] = n%m-10+'A';else{printf("\n无法表示!\n");break;}n /= m;}strrev(tmp);//反转字符串