int n; scanf("%d",&n); while(n){ printf("%d",n%10); n/=10; } printf("\n"); return 0;
/(int) 结果为int 2: 待执行ser函数后,输出结果个位数 12345 % 10 = 5 3: 第二次执行ser函数...类比步骤1 4: 待递归执行ser函数,类比步骤2,输出十位个数 1234 % 10 = 4 5: 类比步骤1 6: 类比步骤2,输出百位个数 123 % 10 = 3 7: 类比步骤1 8: 类比步骤2,输出千位 12 %...
取余,抹掉一个0,取余,抹掉一个0,一直下去#include <stdio.h>int main(){int n;scanf("%d",&n);while(n){printf("%d ",n%10);//输出个位数n/=10;//相当于抹掉后面一个0,下次继续输出个位数}return 0; }
【简答题】编程序输入一个整数,将它逆序输出。要求定义并调用函数reverse(number),它的功能是返回number的逆序数。例如reverse(12345)的返回值是54321。 答案: 手机看题 问答题 【简答题】编程序输入2个正整数m和n(1<=m,n<=1000),输出m到n之间的所有满足各位数字的立方和等于它本身的数。要求定义并调用函数is...