#include <stdio.h>
int main()
{
int n = 0;
int a = 0;
int c = 0;
printf("请输入整数:");
scanf("%d", &n);
printf("逆序为:");
do
{
a = n % 10;
n = n / 10;
printf("%d", a);
c++;
} while (n);
printf("\n该数字共%d位\n", c);
return 0;
}
输入正整数,将其逆序输出,并判断其是几位数(c语言)
最新推荐文章于 2023-08-24 17:15:39 发布