| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138991 | 房知谦 | 最大值与最小值的差 | C++ | Accepted | 0 MS | 272 KB | 584 | 2025-11-30 20:24:15 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int m; cin>>m; int a[m]; int o=0; int p=10000; for(int i=0;i<m;i++){ cin>>a[i]; } for(int i=0;i<m;i++){ if(a[i]>o){ o=a[i]; } } for(int i=0;i<m;i++){ if(a[i]<p){ p=a[i]; } } cout<<o-p; return 0; }