/*N-scale transformation*/
#include<stdio.h>
#include<stdlib.h>
int main() {
int i=0,scale,integral,j,num[20];
printf("Please put a integral: ");
scanf("%d",&integral);
printf("Please put a scale: ");
scanf("%d",&scale);
/*Judging integral*/
do {
i++;
num[i]=integral%scale;
integral=integral/scale;
} while(integral!=0);
printf("The data has converted\n");
for(j=i; j>0; j--)
printf("%d",num[j]);
printf("\n");
system("pause");
return 0;
}
q1480040000
发布了9 篇原创文章 · 获赞 0 · 访问量 414
私信
关注