| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157605 | 汪明轩 | 统计字符数量 | C++ | Compile Error | 0 MS | 0 KB | 410 | 2026-08-04 14:54:58 |
#include<iostream> #include<cstring> using namespace std; int main() { char str[1001]; int cnt[26]; cin>>str; int len=strlen(str) for(int i=0;i<len;i++){ cnt[str[i]-'a']++; } int max=0; char a; for(int i=0;i<26;i++){ if(cnt[i]>max){ max=cnt[i]; a='a'+i; } } cout <<a<<" "<< max; return 0; }
Main.cc: In function 'int main()':
Main.cc:10:5: error: expected ',' or ';' before 'for'
for(int i=0;i