package zh.codegym.task.task05.task0532;
import java.io.*;
/*
有关算法的任务
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(reader.readLine());
int maximum = 0;
if(N> 0){
for(int i =0;i<N;i++){
int count = Integer.parseInt(reader.readLine());
maximum = count > maximum?count:maximum;
}
System.out.println(maximum);
}
}
}
I need the help
正在讨论
评论 (2)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
Anonymous #10862529
13 十一月 2021, 07:27有用的
int maximum = 0; line 13 is Error。
What if all the numbers entered are less than 0?
+1
steven
14 十一月 2021, 05:18
Got it,thanks~
0