Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
124981 | 晏莞煜 | 字符串中最大的数字 | C++ | Compile Error | 0 MS | 0 KB | 396 | 2025-07-13 09:27:21 |
#include<iostream> #include<cstring> using namespace std; char a[100001],b[10001]; int main(){ //strcpy( , ) 将字符数组~复值给~ //strcat( , ) 字符数组拼接 //strcmp(a,b) a>b cout<<"1" a==b cout<<"0" a<b cout<<"-1"; long long n cin>>n; int max=0; if(n<0){ n= -1*n; } while(n>0){ if(max<n%10){ max=n%10; } n=n/10; } cout<<max; return 0; }
Main.cc: In function 'int main()': Main.cc:10:2: error: expected initializer before 'cin' cin>>n; ^ Main.cc:12:5: error: 'n' was not declared in this scope if(n<0){ ^ Main.cc:15:8: error: 'n' was not declared in this scope while(n>0){ ^