Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146478 刘梓含 统计字符数量 C++ Accepted 1 MS 280 KB 360 2026-01-28 19:54:40

Tests(10/10):


Code:

#include <iostream> using namespace std; int main() { char a[10001],d; 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]; d=j+'a'; } } cout<<d<<' '<<max; return 0; }