| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160154 | 鸡哥 | 最大值与最小值的差 | C++ | Accepted | 1 MS | 284 KB | 287 | 2026-09-12 15:36:56 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[10000],m,x=0,c=10000; cin>>m; for(int i=1;i<=m;i++){ cin>>a[i]; } for(int i=1;i<=m;i++){ if(x<a[i]) x=a[i]; } for(int i=1;i<=m;i++){ if(c>a[i]) c=a[i]; } cout<<x-c; return 0; }