joj1059

 

1059: Mary

ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
3s8192K22891035Standard

Mary is a mathematics teacher of Jilin University. This term she teaches mathematics for students of classes of grade 2002. Now the final examination is over and every student has his mathematics score. Mary would like to know what the highest score of each class is and what the highest score of all classes is. But there are too many students take the examination and Mary is too lazy indeed. So she asks you, an expert on programming, to help her solve the problem.

Input Specification

The input consists of several blocks one by one. Each block represents a class, consisting of several lines. Each line of a block consists of a positive integer s, where s<=100, designating a certain student's score of the class. A 0 marks the end of the block. A -1 marks the end of the input. For example,

60 <-- a student's score of class 1
99 <-- another student's score of class 1
85 <-- the last student's score of class 1
0 <-- end of class 1
59 <-- a student's score of class 2
94 <-- another student's score of class 2
0 <-- end of class 2
-1 <-- end of input

Output Specification

You should output the maximum score of each class in the order of classes given in the input. And then, you should also output the maximum score of all classes and the class where the maximum score appears for the first time. For the example above, you should make the output like this:

99 <-- maximum score of class 1
94 <-- maximum score of class 2
99 At Class 1 <-- maximum score of class 1 and class 2

Sample Input

60
99
85
0
59
94
0
-1

Sample Output

99
94
99 At Class 1

Problem Source: 1st JOJ Cup Online VContest Warmup Problem


This problem is used for contest: 75 


Submit / Problem List / Status / Discuss


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值