Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6756 | 詹梓涵 | 最大值与最小值的差 | C++ | Accepted | 0 MS | 272 KB | 500 | 2025-03-15 10:32:57 |
#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 x[10001],m,a=-10001,b=10001; cin>>m; for(int i=1;i<=m;i++){ cin>>x[i]; if(x[i]>a){ a=x[i]; } if(x[i]<b){ b=x[i]; } } cout<<a-b<<endl; return 0; }