Problem E: 调用函数,整数逆序输出
#include<stdio.h> int reverse(int number)//定义函数 { int i,result=0;//result用于储存结果 while(number!=0) { result=result*10; i=number%10; number=number/10; result=result+i; } return result; } int main(void)//主函数 { int n; while(scanf("%d",&n)!=EOF) { printf("%d",reverse(n)); printf("\n"); } printf("\n"); return 0; }