题解 | #反向输出一个四位数#
反向输出一个四位数
https://www.nowcoder.com/practice/1f7c1d67446e4361bf4af67c08e0b8b0
#include <stdio.h>
int main()
{
int n = 0;
scanf("%d",&n);
while(n)
{
int m = 0;
m = n%10;
printf("%d",m);
n = n/10;
}
return 0;
}
反向输出一个四位数
https://www.nowcoder.com/practice/1f7c1d67446e4361bf4af67c08e0b8b0
#include <stdio.h>
int main()
{
int n = 0;
scanf("%d",&n);
while(n)
{
int m = 0;
m = n%10;
printf("%d",m);
n = n/10;
}
return 0;
}
相关推荐