Good evening folks,
I know that my solution is most likely neither beautiful nor efficient but I assume it to be technically correct.
The output is 71 which is the biggest of the inserted numbers... but the affected requirement is still not solved.
I must be doing something wrong. Anyone want to share some wisdom? :-)
Thanks and cheers,
Martin
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 maximum = 0;
int n = 0;
int i = 0;
//schreib hier deinen Code
while (i <= 5) {
i++;
n = Integer.parseInt(reader.readLine());
if (n <= 0) {
break;
}
if (n > maximum) {
maximum = n;
}
// System.out.println(n);
}
if (n > 0) {
System.out.println(maximum);
}
}
}