Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156942 邓弘锐 统计字符数量 C++ Accepted 2 MS 276 KB 313 2026-07-11 15:53:08

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; char a[1000008]; int main() { char max_c; int s[26]= {0},max=0; cin>>a; for(int i=0; a[i]!='\0'; i++) { s[a[i]-'a']++; } for(int j=0; j<26; j++) { if(s[j]>max) { max=s[j]; max_c=j+'a'; } } cout<<max_c<<' '<<max; return 0; }