编程:任意输入一个三位数,计算并输出他的逆序数

如题所述

输入123输出321这种吗?

#include <math.h>
#include <stdio.h>
int main()
{
int x,a,b,c,y;
printf("Input x:\n");
scanf("%d/n",&x);
x=fabs(x);
a=x/100;
b=(x-100*a)/10;
c=x%10;
y=c*100+b*10+a;
printf("y=%d\n",y);
return 0;
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-10-19
输出每种基本数据类型的长度,追答

int len;
len=sizeof(int);
long
double
byte
float
.....
printf("%d\",len);

追问

谢谢

追答


printf("%d\n",len)

本回答被提问者采纳
相似回答