Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
111920 刘佳宇 统计字符数量 C++ Compile Error 0 MS 0 KB 312 2025-03-08 10:54:41

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a[26]; int main(){ string s1; cin>>s1; int len=s1.size(),max=0; for(int i=0;i<len;i++){ a[s1[i]-96]++; } char c; for(int j=1;i<=26) { if(a[j]>max){ max=a[j]; c=j+96; } } cout<<c; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:16: error: 'i' was not declared in this scope
    for(int j=1;i<=26) {
                ^
Main.cc:13:21: error: expected ';' before ')' token
    for(int j=1;i<=26) {
                     ^