Max Num---hdu2071
2015-08-20 16:32
323 查看
Max Num
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 16818 Accepted Submission(s): 10381
[align=left]Problem Description[/align]
There are some students in a class, Can you help teacher find the highest student .
[align=left]Input[/align]
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.
[align=left]Output[/align]
For each case output the highest height, the height to two decimal plases;
[align=left]Sample Input[/align]
2
3 170.00 165.00 180.00
4 165.00 182.00 172.00 160.00
[align=left]Sample Output[/align]
180.00
182.00
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 16818 Accepted Submission(s): 10381
[align=left]Problem Description[/align]
There are some students in a class, Can you help teacher find the highest student .
[align=left]Input[/align]
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.
[align=left]Output[/align]
For each case output the highest height, the height to two decimal plases;
[align=left]Sample Input[/align]
2
3 170.00 165.00 180.00
4 165.00 182.00 172.00 160.00
[align=left]Sample Output[/align]
180.00
182.00
1 #include<stdio.h> 2 int main() 3 { 4 int n,a,i,j; 5 double s[101],max; 6 scanf("%d",&n); 7 while(n--) 8 { 9 scanf("%d",&a); 10 for(i=0;i<a;i++) 11 scanf("%lf",&s[i]); 12 max=s[0]; 13 for(i=1;i<a;i++) 14 max=max>s[i]?max:s[i]; 15 printf("%.2lf\n",max); 16 } 17 return 0; 18 }
相关文章推荐
- 杭电——2033-人见人爱
- 计算两点间的距离-hdu2001
- 求绝对值,hdu-2003
- 计算球体积,hdu-2002
- 计算两点间的距离,hdu-2001
- ASCII码排序,hdu-2000
- 定义#define
- 暑训3周学习心得和英语四级总结
- DOM(一)-19-(节点操作-替换&克隆节点)
- leetcode:Substring with Concatenation of All Words
- Objective-c之NSArray(NSMutableArray)
- (15)Visual Studio中使用PCL项目加入WCF WebService参考
- MySQL数据库常用命令集
- WPF 多项选择下拉菜单
- 序列化二进制方法的实现
- 在类Unix系统上开始Python3编程入门
- 虚拟化--003 利用vsphere client来开启esxi的ssh功能
- 9. 斐波那契数列
- 虚拟化--002 VMware vSphere 创建虚拟机时SCSI适配器的选择
- 神经网络编程入门