Max Num

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 22270    Accepted Submission(s): 13029

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 <iostream>

using namespace std;

int main()
{
int t,count;
double score,max = -1;
cin >> t;
for (int i = 1; i <= t; i++)
{
cin >> count;
max = -1;
while (count--)
{
cin >> score;
max = max > score ? max : score;
}
printf("%.2lf\n", max);
}
}

hdoj:2071的更多相关文章

  1. 算法——A*——HDOJ:1813

    Escape from Tetris Time Limit: 12000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  2. hdoj:题目分类

    基础题: 1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029.1032.1037.1040.1048.1056.1058. ...

  3. HDOJ:1533-Going Home(最小费用流)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1533 解题心得: 第一次写最小费用流的题,去hdoj上找了一个入门级题目,建图比较简单,用了spfa和 ...

  4. hdoj:2086

    A1 = ? Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  5. hdoj:2085

    核反应堆 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  6. hdoj:2084

    数塔 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...

  7. HDOJ:6333-Problem B. Harvest of Apples(组合数学+莫队算法+逆元)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6333 解题心得: 这个题可以说是十分精彩了,首先推组合数学的公式,其中一个很重要的公式是Cnm = C ...

  8. HDOJ:6356-Glad You Came(线段树剪枝)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6356 解题心得: 现在深深的知道了算法复杂度的重要了,这个题算复杂度的时候还要把一些常数也算出来,不然 ...

  9. hdoj:2075

    A|B? Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

随机推荐

  1. JavaScript基础笔记(五) 函数表达式

    函数表达式 一.闭包 概念:闭包是指有权访问另一个函数作用域中变量的函数. function createCompareFun(propertyName) { return function (obj ...

  2. 1490 ACM 数学

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1490 题意: 给出n*n 的矩阵,选出不同行不同列的n个元素,并求和: 如果所有选法所产生的和相等,则输出 ...

  3. go学习资源

    教程 GO 命令教程 Go示例学 Book <Go Web 编程> <Go入门指南> <深入解析Go> 应该是go的进阶,等熟悉go之后再来看 <Go语言圣经 ...

  4. git https 请求报错 504

    git https 请求报错 504 原因可能是因为设置了代理,ubuntu/deepin 系统可以检查 /etc/profile ~/.bashrc 内有没有设置 https 的代理. 有的话,去掉 ...

  5. 在 fragment 里面调用 findViewById

    public class CompanyListFragment  extends Fragment { private Activity activity;   private ListView c ...

  6. django之视图获取用户请求相关信息以及请求头

    def index(request): print(type(request)) print(request.environ['HTTP_USER_AGENT'])#字典格式 print(reques ...

  7. 小甲鱼Python第十三讲课后题--014字符串

     字符串的方法及注释 capitalize()     把字符串的第一个字符改为大写     casefold()     把整个字符串的所有字符改为小写     center(width)      ...

  8. python 生成动态密码

    import stringimport randomdef gen_psd(length=10): """length is password length"& ...

  9. Google C++ 单元测试 GTest

    from : http://www.cnblogs.com/jycboy/p/6057677.html 一.设置一个新的测试项目 在用google test写测试项目之前,需要先编译gtest到lib ...

  10. mount 命令用法

    mount 功能: 加载指定的文件系 统:mount可将指定设备中指定的文件系统加载到 Linux目录下(也就是装载点).可将经常使用的设备写入文件/etc/fastab,以使系 统在每次启动时自动加 ...