杭电acm--2071

来源:互联网 发布:德军 知乎 编辑:程序博客网 时间:2024/06/08 04:18



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;


#include<stdio.h>#include<stdlib.h>#include<math.h>//#include<string.h>//#define P 3.141592653void main(){int t, n;double max, arr[100];scanf("%d", &t);while (t--){scanf("%d", &n);for (int i = 0; i<n; i++)scanf("%lf", &arr[i]);max = arr[0];for (int i = 1; i<n; i++)if (max<arr[i])max = arr[i];printf("%.2lf\n", max);}system("pause");}


0 0