Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155118 卢语宸 统计字符数量 C++ Accepted 1 MS 268 KB 327 2026-05-31 15:14:12

Tests(10/10):


Code:

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