Всем привет. Помогите, пожалуйста, найти ошибку. С отрицательными числами проверяла, все работает. Уже много всего перепробовала, но последнее условие так и не проходит.
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = 0;
//напишите тут ваш код
int N = Integer.parseInt(reader.readLine());
for (int i = 0; i < N; i++ ){
int B = Integer.parseInt(reader.readLine());
if (B > maximum) {maximum = B;}
}
System.out.println(maximum);
}
}
package com.javarush.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 maximum = 0;
//напишите тут ваш код
int N = Integer.parseInt(reader.readLine());
for (int i = 0; i < N; i++ ){
int B = Integer.parseInt(reader.readLine());
if (B > maximum) {maximum = B;}
}
System.out.println(maximum);
}
}