#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,x,y,maxn=0;
	cin>>n; 
	while(n--){
		cin>>x;
  		long long sumn=0;
		for(int i=x;i>0;i=i/10){
			sumn+=i%10;
		}
		maxn=max(maxn,sumn);
	}
	cout<<maxn;
	return 0;
} 

0 comments

No comments so far...

Information

ID
2548
Time
1000ms
Memory
256MiB
Difficulty
8
Tags
# Submissions
13
Accepted
8
Uploaded By