2025-03-06 22:45:14 +08:00

25 lines
549 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
功能编写程序输入三位数100-999然后按数字逆序输出。输入456↙输出654
--------------------------------------------------------*/
#include <stdio.h>
void main()
{
int n,ge,shi,bai;
printf("请输入一个三位正整数:");
scanf("%d",&n);
if((n<100)||(n>999))
printf("输入数据有误!\n");
else
{
/**********Program**********/
ge = n % 10;
shi = n % 100 / 10;
bai = n / 100;
/********** End **********/
printf("此数的逆序输出结果为:%d%d%d\n",ge,shi,bai);
}
}