-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1157.cpp
More file actions
44 lines (41 loc) · 718 Bytes
/
Copy path1157.cpp
File metadata and controls
44 lines (41 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int cnt[130];
int result[50];
int try1;
int main()
{
ios_base :: sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string input;
cin>>input;
int leng=input.length();
for(try1=0;try1<leng;try1++)
cnt[input[try1]]++;
for(try1=1;try1<=26;try1++)
result[try1]=cnt[64+try1]+cnt[96+try1];
int temp=0;
int tempi=0;
for(try1=1;try1<=26;try1++)
{
if(temp<result[try1])
{
temp=result[try1];
tempi=try1;
}
}
result[tempi]=0;
for(try1=1;try1<=26;try1++)
{
if(result[try1]==temp)
break;
}
if(try1!=27)
cout<<"?"<<'\n';
else
cout<<(char)(tempi+64)<<'\n';
return 0;
}