| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 142086 | 向俊麒 | 最大值与最小值的差 | C++ | Compile Error | 0 MS | 0 KB | 514 | 2025-12-30 18:14:44 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ using namespace std; int main() { int a; cin>>a; int b[a],d=0,e=10000; 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; } return 0; }
Main.cc: In function 'int main()':
Main.cc:12:1: error: a function-definition is not allowed here before '{' token
{ int a; cin>>a;
^
Main.cc:30:1: error: expected '}' at end of input
}
^