| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 77166 | 苏馨怡 | 最大值与最小值的差 | C++ | Accepted | 1 MS | 272 KB | 311 | 2024-06-08 15:33:41 |
#include<iostream> using namespace std; int main() { int n, mxx = 0, ndd = 10000; cin >> n; int a[100] = {}; for (int i = 1; i <= n; i++) { cin >> a[i]; //TODO } for (int i = 1; i <= n; i++) { if (a[i] > mxx) { mxx = a[i]; } if(ndd>a[i]){ ndd=a[i]; } } cout<<mxx-ndd; }