Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6754 | 谢锦卓 | 最大值与最小值的差 | C++ | Compile Error | 0 MS | 0 KB | 457 | 2025-03-15 10:31:20 |
#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(){ int a[10001],m; cin>>m; int x=-10001,n=10001 for(int i=1;i<=x;i++){ cin>>a[i]; if(a[i]>x){ n=a[i]; } } cout<<x-n<<endl return 0; }
Main.cc: In function 'int main()': Main.cc:11:5: error: expected ',' or ';' before 'for' for(int i=1;i<=x;i++){ ^ Main.cc:11:17: error: 'i' was not declared in this scope for(int i=1;i<=x;i++){ ^ Main.cc:11:25: error: expected ';' before ')' token for(int i=1;i<=x;i++){ ^ Main.cc:8:9: warning: unused variable 'a' [-Wunused-variable] int a[10001],m; ^ Main.cc:10:18: warning: unused variable 'n' [-Wunused-variable] int x=-10001,n=10001 ^ Main.cc:19:1: error: expected '}' at end of input } ^