-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path1255.cpp
More file actions
37 lines (32 loc) · 663 Bytes
/
1255.cpp
File metadata and controls
37 lines (32 loc) · 663 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
int v[4000];
int n;cin >> n;
getchar();
while(n--)
{
memset(v,0,sizeof v);
char s[8000];
scanf(" %[^\n]",s);
getchar();
int mai=0;
for(int i=0;i<strlen(s);i++)
{
if(s[i]>=65 && s[i]<=90)s[i]=tolower(s[i]);
if(s[i]>=97 && s[i]<=122)
{
int q=s[i];
v[q]++;
if(v[q]>mai)mai=v[q];
}
}
for(char i='a';i<='z';i++)
{
if(v[i]==mai)printf("%c",i);
}
printf("\n");
}
return 0;
}