Untitled
unknown
c_cpp
2 years ago
222 B
4
Indexable
#include <iostream>
int countDigits(int number) {
int res = 0;
do {
number /= 10;
res++;
} while (number > 0);
return res;
}
int main() {
int n = 0;
std::cin >> n;
std::cout << countDigits(n);
}Editor is loading...
Leave a Comment