| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 141581 | 杨启宏 | 最大值与最小值的差 | C++ | Accepted | 0 MS | 276 KB | 514 | 2025-12-27 13:23:30 |
#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 a; cin>>a; int b[a],d=0,e=10000; for(int i=0;i<a;i++){ cin>>b[i]; } for(int c=0;c<a;c++){ if(b[c]>d) d=b[c]; if(b[c]<e) e=b[c]; } cout<<d-e; return 0; }