Difficult to satisfy this condition;
Le programme doit afficher le plus grand des n nombres saisis.
package fr.codegym.task.task05.task0532;
import java.io.*;
/*
Mission sur les algorithmes
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader lecteur = new BufferedReader(new InputStreamReader(System.in));
//double n = Double.parseDouble(lecteur.readLine());
//float n = Float.parseFloat(lecteur.readLine());
int n = Integer.parseInt(lecteur.readLine());
int maximum = -1;
int nombre = 0;
int counter = 0;
while(n != counter && n > 0) {
nombre = Integer.parseInt(lecteur.readLine());
//if (nombre < 0 ) nombre = -(nombre);
if (maximum < nombre) {
maximum = nombre;
}
++counter;
}
//écris ton code ici
if (n>0)
System.out.println(maximum);
}
}