Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2925 邓小龙 两个数的最小距离 C++ Compile Error 0 MS 0 KB 426 2024-03-09 18:00:42

Tests(0/0):


Code:

# include<iostream> # include<iomanip> //# include<limits.h> using namespace std; int n; long long a[1001],_min=LLONG_MAX; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; //从第1个数开始,逐位减后面的每一个数 for(int i=1;i<n;i++){ for(int j=i+1;j<=n;j++){ _min=min(_min,abs(a[i]-a[j])); } } cout<<_min<<endl; return 0; }


Run Info:

Main.cc:6:24: error: 'LLONG_MAX' was not declared in this scope
 long long a[1001],_min=LLONG_MAX;
                        ^