Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
252 B
0
Indexable
Never
#include <iostream>

using namespace std;

int count_of_digits(int a) {
	int temp = a;
	int count = 0;
	while (temp > 0) {
		temp /= 10;
		count += 1;
	}
	return count;
	
}

int main() {
	int a;
	cin >> a;
	int res = count_of_digits(a);
	cout << res;
}
Leave a Comment