Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155397 王晏林 统计字符数量 C++ Runtime Error 1 MS 280 KB 325 2026-06-07 11:28:08

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { char s[27]={}; int sum[1001]={},max=0; cin>>s; int i=0; while(s[i]!='\0'){ sum[s[i]]++; if(max<sum[s[i]])max=sum[s[i]]; i++; } for(char c='a';c<='z';c++){ if(max==sum[c]){ cout<<c<<' '<<max<<endl; break; } } return 0; }


Run Info:

Runtime Error:Segmentation fault