Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
112395 | 陈骏睿 | 两个数的最小距离 | C++ | Compile Error | 0 MS | 0 KB | 520 | 2025-03-09 14:07:28 |
#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 n,a[1000],x,=0,min=1000; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ x=a[i]-a[j]; if(min>x){ min=x; } } } cout<<min<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:7:21: error: expected unqualified-id before '=' token int n,a[1000],x,=0,min=1000; ^ Main.cc:8:5: error: 'cin' was not declared in this scope cin>>n; ^ Main.cc:15:16: error: 'min' was not declared in this scope if(min>x){ ^ Main.cc:20:5: error: 'cout' was not declared in this scope cout<