题解 | #获取数组最值#
获取数组最值
http://www.nowcoder.com/practice/53d110f6cdd14f21af285698f975b59c
#include <iostream>
using namespace std;
int main() {
int arr[6] = { 0 };
int len = sizeof(arr) / sizeof(int);
for (int i = 0; i < len; i++) {
cin >> arr[i];
}
// write your code here......
cout << min(min(min(arr[0], arr[1]),min(arr[2], arr[3])), min(arr[4], arr[5])) << " " << max(max(max(arr[0], arr[1]),max(arr[2], arr[3])), max(arr[4], arr[5])) << endl;
return 0;
}