BUPT-homework/pset7/3-getDigit.c
2021-11-04 19:42:37 +08:00

17 lines
277 B
C

#include <stdio.h>
int getDigit(long long n);
int main() {
long long n;
int len;
scanf("%lld", &n);
len = getDigit(n);
if (len > 1)
printf("The integer %lld has %d digits.\n", n, len);
else
printf("The integer %lld has %d digit.\n", n, 1);
return 0;
}