#include <stdio.h>
int main()
{
int x,p;
printf("Enter the new base");
scanf("%d",&p);
printf("Enter the number to be converted");
scanf("%d",&x);
int a[100];
int count=0;
do
{
a[count++]=x%p;
x=x/p;
}
while(x!=0);
for(int i=count-1;i>=0;i--)
{
printf("%d",a[i]);
}
return 0;
}
标签:count,进制,int,scanf,C语言,转化,printf From: https://www.cnblogs.com/cjs20030409/p/16766618.html