该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
main()
{
int x;
int a,b,c,d,e,t;
printf("请输入一个整数:");
scanf("%d",&x);
{ if (x/100000>=1)
printf("输入的数超过5位\n");
else if (x/10000>=1)
printf("要处理的数为5位数\n");
else if(x/1000>=1)
printf("要处理的数为4位数\n");
else if(x/100>=1)
printf("要处理的数为3位数\n");
else if(x/10>=1)
printf("要处理的数为2位数\n");
else if(x>=1)
printf("要处理的数为1位数\n");
else
printf("输入负数\n");
}
{
if (x/10000>=1)
a=x/10000;
x=x%10000;
printf("该数万位为%d\n",a);
if (x/1000>=1)
b=x/1000;
x=x%1000;
printf("该数千位为%d\n",b);
if (x/100>=1)
c=x/100;
x=x%100;
printf("该数百位为%d\n",c);
if (x/10>=1)
d=x/10;
x=x%10;
printf("该数十位为%d\n",d);
if (x>=1)
e=x;
printf("该数个位为%d\n",e);
printf("该数正序排列为%d%d%d%d%d\n",a,b,c,d,e);
printf("该数倒序排列为%d%d%d%d%d\n",e,d,c,b,a);
}
程序运行一直会出现内存的数据