C语言之逆序数

#include<stdio.h>
int main()
{
int num;
int a,b,c,result,d,result1;
scanf("%d",&num);
a=num/100;
b=num%10;
c=num%100/10;
d=num/10%10;
printf("%d %d %d\n",a,b,c);
result=b*100+c*10+a;
result1=b*100+d*10+a;
printf("%d\n",result);
printf("%d\n",result1);

return 0;
}
//注意:在两个数做运算时,只要有一个是浮点数,计算的结果均为浮点数!

posted @ 2016-08-02 14:28  A-inspire  Views(2314)  Comments(0Edit  收藏  举报