#include <bits/stdc++.h>
using namespace std;
string a[110];
int cnt[110];
int main() {
int n;
cin >> n;
for(int i=1;i<=n;i++){
cin >> a[i];
//处理成小写
for(auto &c: a[i]) c = tolower(c);
// for(int j=0;j<a[i].size();j++) a[i][j] = tolower(a[i][j]);
}
//遍历数组,统计每个string出现的次数
for(int i=1;i<=n;i++){
//将统计的字符串
string x = a[i];
//再次遍历数组 ,找x出现了几次
for(int j=1;j<=n;j++) {
if(x == a[j]) cnt[i] ++;
}
}
//对cnt打擂,找到最多出现的次数;
int mi = 1;
for(int i=1;i<=n;i++) {
if(cnt[i] > cnt[mi]) mi = i;
}
cout << a[mi];
return 0;
}
—— 本文来自火龙信奥(义乌睿码科技):义乌青少年信息学奥赛与编程教育平台,专注 CSP-J/S、NOIP、GESP 竞赛培训,线上线下融合教学,助力编程升学。网址:hlcoding.com