Max Num (maximum number)

Source: Internet
Author: User

Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 16377 Accepted Submission (s): 10155


Problem Descriptionthere is some students in a class, Can-Help teacher find the highest student.
Inputthere is some cases. The first line contains an integer t, indicate the cases; Each case has an integer n (1≤n≤100), followed n students ' height.
Outputfor each case output of the highest height, the height to both decimal plases;
Sample Input
23 170.00 165.00 180.004 165.00 182.00 172.00 160.00

Sample Output
180.00182.00
Problem description


In a class there are some students who can help teachers find the highest students.


Input


In some cases. The first line contains an integer t, which is an example; in each case there is an integer N (1≤n 100,n≤) that follows the student's height.


Output


For each case the maximum height of the output, the height reserved 2 decimal places;

#include <stdio.h>

Main ()
{
float a,b,x[1000];
int i,j,n,k;
scanf ("%d", &n);
while (n--)
{
scanf ("%d", &k);
for (i=0;i<k;i++)
scanf ("%f", &x[i]);
B=X[0];
for (i=0;i<k;i++)
if (B<x[i])
B=x[i];
printf ("%.2f\n", b);
}
return 0;
}

Max Num (maximum number)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.