作业帮 > 综合 > 作业

hdu 2071 很水的题的问题

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/14 02:10:00
hdu 2071 很水的题的问题
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
using namespace std;
int main()
{
int n,i,m,j;
double tall[100];
while(1==scanf("%d",&n))
{
for(i=1;i
这个可以这么做,但在acm中不行,它的答案要求不一样,所能接受的正确答案也不一样.
后面的float 不行,acm 中的潜规则,有小数点就需要double. 再问: 为什么数组不能?格式都一样的啊。要求也一样的啊。
再答: 这个它的答案要求就是这样,没有理由,有的话就是数组浪费很大内存,运行比不用慢。
再问: 没有超时。是WA
再答: 你以后就会明白的,就像有些时候你要考虑A+B有些事后你要考虑大整数,有些时候你不要考虑一样的,这是他的online系统检查你是否出错的模式不同,懂?