HDU——2071Max Num
来源:互联网 发布:淘宝转让合法吗 编辑:程序博客网 时间:2024/06/07 01:12
Max Num
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20234 Accepted Submission(s): 12088
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
23 170.00 165.00 180.004 165.00 182.00 172.00 160.00
Sample Output
180.00182.00
Author
Lily
Source
浙江工业大学网络选拔赛
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2071
AC代码:
import java.util.*;class Main{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); while(sc.hasNext()) { int n=sc.nextInt(); double[] a=new double[1000]; while(n-->0) { int m=sc.nextInt(); a[0]=sc.nextDouble(); double max=a[0]; for(int i=1; i<m; i++) { a[i]=sc.nextDouble(); if(a[i]>max) max=a[i]; } System.out.printf("%.2f",max); System.out.println(); } } }}
0 0
- HDU——2071Max Num
- HDU 2071 Max Num
- HDU 2071 Max Num
- hdu-2071-Max Num
- hdu 2071 Max Num
- HDU 2071 Max Num
- HDU 2071 Max Num
- HDU 2071 -- Max Num
- HDU 2071 Max Num
- HDU 2071 Max Num
- hdu 2071 Max Num
- C++ hdu 2071 Max Num
- 1003——max num
- hdu 2071 Max Num (水题)
- 2071 Max Num
- Max Num 2071
- 2071 Max Num
- HDUJ 2071 Max Num
- "a".equals(null)为false, a= null,a.equals()就不行了
- iOS怎样获取手机的ip地址
- 3、C语言的变量简易理解
- Java学习之反射机制学习总结--1
- C语言基础 产生随机数0到9
- HDU——2071Max Num
- 总结下常见java工程师不懂的几个很重要的问题
- Android杂谈(5):ViewPager中Fragment跳转时出现界面无任何展示
- 将ocx和DLL文件打包成cab文件,实现IE浏览器在线安装
- LuaTeX-ja与中文排版笔记
- 深入理解JVM02--运行时数据区域
- IPMI
- Android学习笔记八:SQLite判断一张表是否存在
- V2013中应用程序无法正常启动0xc00007b