1 solutions
-
0
#include<bits/stdc++.h> using namespace std; const int N=110; string s[N]; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { string x; cin>>x; for(int j=0;j<x.size();j++) { if(x[j]>='A'&&s[j]<='Z') { x[j]=x[j]-'A'+'a'; } } s[i]=x; } int maxv=0; string res; for(int i=1;i<=n;i++) { int cnt=0; for(int j=1;j<=n;j++) { if(s[i]==s[j]) { cnt++; } } if(cnt>maxv) { maxv=cnt; res=s[i]; } } cout<<res; return 0; }
- 1
Information
- ID
- 2564
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 19
- Accepted
- 8
- Uploaded By