main body:
int a = 0,b = 0;
printf("请输入a的值(a为五位数):");
scanf_s("%d", &a);
Positive sequence:
int f = a;
for (int i = 0; i <5; i++)//逆序
{
b= f%10;
f = f / 10;
printf("%d ",b);
}
Reverse:
int c = 10000, d;
int g = a;
for (int i = 0; i < 5; i++)//正序
{
d= g / c;
g = g -d*c;
c = c / 10;
printf("%d ", d);
}
Note: This code is pure C language, vs2019;
Welcome to ask questions!