| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146659 | 汪义罗 | 字符串中最大的数字 | C++ | Compile Error | 0 MS | 0 KB | 410 | 2026-01-29 14:42:44 |
#include<bits/stdc++.h> using namespace std; int main(){ char a[20]; cin>>a; int m=a[0]-'0'; int i=0; while(a[i]!='\0'){ if(a[i]-'0'>m)m=a[i]-'0'; i++; } cout<<m; } return 0; #include<bits/stdc++.h> using namespace std; int main(){ char a[20]; cin>>a; int m=a[0]-'0'; int i=0; while(a[i]!='\0'){ if(a[i]-'0'>m)m=a[i]-'0'; i++; } cout<<m; } return 0;
Main.cc:16:2: error: expected unqualified-id before 'return'
return 0;
^
Main.cc: In function 'int main()':
Main.cc:21:5: error: redefinition of 'int main()'
int main(){
^
Main.cc:5:5: note: 'int main()' previously defined here
int main(){
^
Main.cc: At global scope:
Main.cc:32:2: error: expected unqualified-id before 'return'
return 0;
^