Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6613 | 黄言岐 | 两个数的最小距离II | C++ | Compile Error | 0 MS | 0 KB | 584 | 2025-03-08 15:00:34 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<limits.h> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ long long n,a[1001],temp,_min=LLONG_MAX; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n-1;i++){ temp=a[i]; for(int j=i+1;j<=n;j++){ _min=min(abs(temp-a[j]),_min); } } } cout<<_min<<endl; return 0; }
Main.cc:20:5: error: 'cout' does not name a type cout<_min<<endl; ^ Main.cc:21:5: error: expected unqualified-id before 'return' return 0; ^ Main.cc:22:1: error: expected declaration before '}' token } ^