- chenxueze's blog
数位和
- 2024-12-11 21:03:56 @
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,num,sum,maxx = 0;
cin >> n;
while (n--) {
cin >> num;
sum = 0;
while (num != 0){
sum += num % 10;
num /= 10;
}
if (sum > maxx) {
maxx = sum;
}
}
cout<<maxx;
return 0;
}