Hi all,
I cannot find the mistake ... the programme actually does what it should. I read also a lot of other threads in the q-section here but didn´t find the solution. Any hint? Thank You.
package de.codegym.task.task05.task0532;
import java.io.*;
/*
Aufgabe zu Algorithmen
*/
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());
for (int j = 0; n <= 0; j++) {
n = Integer.parseInt(reader.readLine());
}
int maximum = n;
/* if (n <= 0) {}
else if (n > 0) {
maximum = n;
} */
for (int i = 0; n > 0; i++) {
n = Integer.parseInt(reader.readLine());
if (n > maximum) {
maximum = n;
}
else if (n <= 0) {
System.out.println(maximum);
break;
}
}
}
}