| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 75486 | 申明宇 | 统计字符数量 | C++ | Compile Error | 0 MS | 0 KB | 367 | 2024-05-26 18:58:14 |
#include<iostream> #include<string> using namespace std; int main(){ char a[1001],c; int b[128]={0}; cin>>a; int i=0,max=0; while(s[i]!='\0'){ b[a[i]]++; i++; } for(i=0;i<128;i++){ if(b[i]>max){ max=b[i]; c=char(1); } } cout<<c<<" "<<max; return 0; }
Main.cc: In function 'int main()':
Main.cc:9:11: error: 's' was not declared in this scope
while(s[i]!='\0'){
^
Main.cc:10:15: warning: array subscript has type 'char' [-Wchar-subscripts]
b[a[i]]++;
^