#include <iostream>
#include <algorithm>
using namespace std;
int main(){
string s;
cin >> s;
int a[26]={0,};
int max = 0;
int cnt;
int index;
transform(s.begin(),s.end(),s.begin(),::toupper);
for(int i=0; i<s.length(); i++){
a[s[i] - 'A']++;
}
for(int i=0; i<26; i++){
if(max < a[i]){
max = a[i];
cnt = 0;
index = i;
}
if(max == a[i]){
cnt++;
}
}
if(cnt > 1) cout << "?";
else cout << (char)(index + 'A');
return 0;
}
'백준알고리즘' 카테고리의 다른 글
백준 2908 C++ (0) | 2021.07.02 |
---|---|
백준 1152 C++ (0) | 2021.07.01 |
백준 2675 C++ (0) | 2021.07.01 |
백준 10809 C++ (0) | 2021.06.30 |
백준 1065 C++ (0) | 2021.06.30 |