| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 76055 | 朱子相 | 最大值与最小值的差 | C++ | Compile Error | 0 MS | 0 KB | 284 | 2024-06-01 15:41:39 |
#include<iostream> #include<iomanip> using namespace std; int main() { int n,mxx = 0,ndd = 10000; cin>>n; int a[1001]; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ mxx = a[i]; } if(ndd > a[i]){ ndd = a[i] } } cout<<mxx-ndd;
Main.cc: In function 'int main()':
Main.cc:15:13: error: 'i' was not declared in this scope
if(ndd > a[i]){
^
Main.cc: At global scope:
Main.cc:21:1: error: 'cout' does not name a type
cout<