| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146643 | 李折曦 | 字符串中最大的数字 | C++ | Compile Error | 0 MS | 0 KB | 214 | 2026-01-29 14:39:42 |
#include <bits/stdc++.h> using namespace std; int main (){ char n[11]; cin>>n; int m=a[0]-'0'; int n=strlen(a); while(n[i]!='\0'){ if(n[i]-'0'>m)m=n[i]-'0'; i++; } cout<<m; return 0; }
Main.cc: In function 'int main()':
Main.cc:6:8: error: 'a' was not declared in this scope
int m=a[0]-'0';
^
Main.cc:7:6: error: conflicting declaration 'int n'
int n=strlen(a);
^
Main.cc:4:7: note: previous declaration as 'char n [11]'
char n[11];
^
Main.cc:8:10: error: 'i' was not declared in this scope
while(n[i]!='\0'){
^