#include<string>
using namespace std;
int main()
{
string str;
int n,count,x,y,z,j;
cin >> n;
cin.ignore();
for (int i = 0;i < n; i++)
{
x = 0;
y = 0;
z = 0;
j = 0;
count = 0;
getline(cin,str);
for (int a = 0;a < str.length(); a++)
{
count = 0;
for (int b = 0;b < str.length(); b++)
{
if (str[a] == str[b])
count++;
}
if (count > x)
{
if (count > y)
{
z = count;
j = a;
}
y = count;
}
if (a == str.length() - 1)
{
cout << str[j] << endl;
break;
}
x = count;
}
}
return 0;
}
沒有留言:
張貼留言