'commit'
This commit is contained in:
17
TangDou/XiTi/1068.cpp
Normal file
17
TangDou/XiTi/1068.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int M;
|
||||
cin >> M;
|
||||
int max = INT32_MIN, min = INT32_MAX;
|
||||
for (int i = 0; i < M; ++i) {
|
||||
int c;
|
||||
cin >> c;
|
||||
if (c > max)max = c;
|
||||
if (c < min)min = c;
|
||||
}
|
||||
cout << max - min << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user