Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164192 岑思烁 统计字符数量 C++ Accepted 1 MS 272 KB 300 2026-11-01 11:30:40

Tests(10/10):


Code:

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