/*编程,输入一个正整数 repeat (0
#include<stdio.h>
int main()
{
int repeat,ri;
int a,b,c;
scanf("%d",&repeat);
for(ri=1;ri<=repeat;ri++)
{
scanf("%d",&a);
scanf("%o",&b);
scanf("%x",&c);
printf("The decimal is %d, the octal is %o, the hexadecimal is %x.\n",a,a,a);
printf("The decimal is %d, the octal is %o, the hexadecimal is %x.\n",b,b,b);
printf("The decimal is %d, the octal is %o, the hexadecimal is %x.\n",c,c,c);
}
return 0;
}
本文介绍了一个使用C语言编写的程序,该程序能够接收用户输入的正整数,并将其在十进制、八进制及十六进制之间进行转换。通过简单的界面交互,用户可以输入三个不同类型的数值,然后程序会输出这些数值在三种进制下的表示形式。
3524

被折叠的 条评论
为什么被折叠?



