正整数的打印.c 328 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. int main() {
  3. int input,lenth = 0;
  4. scanf("%d",&input);
  5. int input2 = input;
  6. while(input > 0) {
  7. lenth++;
  8. input /= 10;
  9. }
  10. printf("%d\n",lenth);
  11. printf("%d\n",input2);
  12. while (input2 > 0) {
  13. int digit = input2 % 10;
  14. printf("%d", digit);
  15. input2 /= 10;
  16. }
  17. return 0;
  18. }