Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
102215 | 刘宇帆 | 最大值与最小值的差 | C++ | Compile Error | 0 MS | 0 KB | 286 | 2024-12-21 13:27:49 |
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; int b[a]; int c=0; int d<10000; int e; for(int i=0;i<a;i++){ cin>>b[i]; } for(int c=0;c<a;c++){ if(b[c]>d){ d=b[c]; } if(b[c]<e){ e=b[c]; } } cout<<d-e; return 0; }
Main.cc: In function 'int main()': Main.cc:8:7: error: expected initializer before '<' token int d<10000; ^ Main.cc:14:11: error: 'd' was not declared in this scope if(b[c]>d){ ^ Main.cc:21:8: error: 'd' was not declared in this scope cout<