Problem Description
There are some students in a class, Can you help teacher find the highest student .
Input
There are some cases. The first line contains an integer t, indicate the cases; Each case have an integer n ( 1 ≤ n ≤ 100 ) , followed n students’ height.
Output
For each case output the highest height, the height to two decimal plases;
Sample Input
2
3 170.00 165.00 180.00
4 165.00 182.00 172.00 160.00
Sample Output
180.00
182.00
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
const double inf=1e20;
const int maxn=100+10;
const int mod=1e9+7;
int main(){
int t;
scanf("%d",&t);
while(t--){
double a;
double m=0;
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%lf",&a);
m=max(m,a);
}
printf("%.2lf\n",m);
}
return 0;
}
来源:https://www.cnblogs.com/wz-archer/p/12446688.html