Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
373 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 max = 1;
	int n;
	cin >> n;
	int a;
	int temp = n;
	while (temp > 0) {
		cin >> a;
		temp -= 1;
		if (count_of_digits(a) > count_of_digits(max)) {
			max = a;
		}
	}
	cout << max;
}
Leave a Comment