Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147598 鸡哥 最大值与最小值的差 C++ Accepted 0 MS 288 KB 235 2026-02-06 13:52:09

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a[10001],b,d,x; cin>>b; cin>>a[1]; x = d = a[1]; for(int i = 2;i<=b;i++){ cin>>a[i]; if(a[i] > x)x=a[i]; if(a[i] < d)d = a[i]; } cout<<(x-d); }