题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2970重点内容
给出几个数字 根据要求输出最大或最小值
#include<iostream>
#include<cstdio>
#include<set>
#include<string>
#include<string.h>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<algorithm>
#define mt(a) memset(a,0,sizeof a)
#define fl(a,b,c) fill(a,b,c)
#define inf 1000000000+7
using namespace std;
typedef long long ll;
int ans[3000];
int main()
{
int T;
cin >> T;
while (T--)
{
string type;
cin >> type;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
scanf("%d", &ans[i]);
}
sort(ans, ans + n);
if (type == "Faster")
printf("%d\n", ans[0]);
else printf("%d\n", ans[n - 1]);
}
return 0;
}