2 solutions
- 1
Information
- ID
- 31
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 6
- Tags
- # Submissions
- 28
- Accepted
- 10
- Uploaded By
C++ :
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
cin >> n;
int x = 0;
for (int i = 0; i < n; i++) {
int smu = 0;
ll tmp;
cin >> tmp;
while (tmp > 0) {
smu += tmp % 10;
tmp /= 10;
}
x = max(x, smu);
}
cout << x << endl;
return 0;
}
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.