清华大学机试 最大最小值 Easy

基本思想:

无;

 

关键点:

无;

 

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<map>
using namespace std;

const int maxn = 10010;

int ma[maxn];

int main() {
	int n;
	while (cin>>n){
		for (int i = 0; i < n; i++) {
			cin >> ma[i];
		}
		sort(ma, ma + n);
		cout << ma[n - 1] << " " << ma[0] << endl;
	}
	return 0;
}

  

posted @ 2020-03-02 11:58  暮云林凌  阅读(177)  评论(0)    收藏  举报