Untitled
unknown
plain_text
2 years ago
373 B
6
Indexable
#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;
}Editor is loading...
Leave a Comment