Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76052 陈杨锦鸿 最大值与最小值的差 C++ Accepted 0 MS 284 KB 272 2024-06-01 15:38:43

Tests(10/10):


Code:

#include<iostream> #include<iomanip> using namespace std; int main(){ int a[10001],m,mxx=0,ndd=10000; cin>>m; for(int i=1;i<=m;i++){ cin>>a[i]; } for(int i=1;i<=m;i++){ if(mxx<a[i]){ mxx=a[i]; } if(ndd>a[i]){ ndd=a[i]; } }cout<<mxx-ndd; }