怎么程序写了之后输入102输出20,输入101输出1,输入12345输出543210.
/*把输入的数逆序输出,而且要不限位数*/
#include <stdio.h>
int main(void)
{ int b, n, m = 0; printf("Enter a number: "); scanf("%d", &b); do { n = b % 10; b /= 10; m = m * 10 + n;
} while (n > 0); printf("The reversal is: %d\n", m); return 0;
}