Untitled

 avatar
unknown
c_cpp
a year ago
222 B
3
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