nord vpnnord vpn
Ad

Untitled

mail@pastecode.io avatar
unknown
c_cpp
20 days ago
409 B
0
Indexable
Never
#include <iostream>
int countDigits(int number) {
	int res = 0;
	do {
		number /= 10;
		res++;
	} while (number > 0);
	return res;
}


int main() {
	int n = 0;
	int tmp = 0;
	int maxCountDigits = 0;
	std::cin >> n;

	for (int i = 0; i < n; i++) {
		std::cin >> tmp;
		if (countDigits(tmp) > countDigits(maxCountDigits)) {
			maxCountDigits = tmp;
		}
	}
	std::cout << maxCountDigits;
}
Leave a Comment


nord vpnnord vpn
Ad