Files
information-processing-1_13…/programs/p412/main.c
2025-07-10 12:10:31 +09:00

25 lines
400 B
C

#include <stdio.h>
int main(void) {
int n;
do {
printf("Input positive integer: ");
scanf("%d", &n);
if (n <= 0) {
puts("\aPlease input non-negative, non-zero integer.");
}
} while (n <= 0);
int d = 0;
int x = n;
while (x > 0) {
x /= 10;
d++;
}
printf("%d is %d digit number.\n", n, d);
return 0;
}