Run ID:78936
提交时间:2024-06-29 14:18:28
#include<bits/stdc++.h> using namespace std; char str[1000]; char e; int m[26]; int i,b; int max1,max2; int m1; int main(){ cin.getline(str,1000); while(str[i]!='\0'){ b=str[i]-97; m[b]++; i++; } max1=m[0]; m1=0; for(int f=1;f<26;f++){ max2=m[f]; if(max2>max1){ max1=max2; m1=f; } } e=m1+97; cout<<e<<' '<<m[m1]; return 0; }