#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]);}}
200字范文,内容丰富有趣,生活中的好帮手!