题解 | #反向输出一个四位数#
反向输出一个四位数
https://www.nowcoder.com/practice/1f7c1d67446e4361bf4af67c08e0b8b0
#include <stdio.h> int main() { int a, b,s=0; while (scanf("%d",&a) != EOF) { // 注意 while 处理多个 case // 64 位输出请用 printf("%lld") to if(a>=1000&&a<=9999) do { b=a%10; s=s*10+b; a/=10; }while (a!=0); printf("%04ld",s); } return 0; }