링크 : https://www.acmicpc.net/problem/1157
#include <iostream>
#include <string>
using namespace std;
int main() {
string s = "";
cin >> s;
for(char& ch : s)
ch = toupper(ch);
int arr[26] = {0, };
for(char& ch : s){
arr[ch - 'A'] ++;
}
int max = 0;
int index = 0;
for(int i = 0; i < 26; i++){
if(arr[i] > max){
max = arr[i];
index = i;
}
}
int count = 0;
for(int i = 0; i < 26; i++){
if(arr[i] == max)
count ++;
}
if (count == 1)
cout << (char)(index + 'A') << endl;
else
cout << "?" << endl;
return 0;
}