| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 39409 | yuzhengxun | 最大值和最小值的差 | C++ | Accepted | 1 MS | 244 KB | 241 | 2024-02-01 15:11:57 |
#include<bits/stdc++.h> using namespace std; int a[1001]; int main() { int n,md=-1,mx=1000; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]>md){ md=a[i]; } if(a[i]<mx){ mx=a[i]; } } cout<<md-mx; return 0; }