hdu 2071 Max Num

我的梦境 提交于 2020-03-09 09:46:47

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;
}

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!