include <stdio.h>
int main(){
int number,newbase; //number为十进制数,newbase为目标进制大小
printf("Input number:\n");
scanf("%d",&number);
printf("Input newbase:\n");
scanf("%d",&newbase);
int a[100]; //存放余数
int count=0;
do{
a[count++]=number%newbase;
number=number/newbase;
}while(number!=0);//当商不为0时进行循环
for(int i=count-1;i>=0;i--){
printf("%d",a[i]);
}
}