Hello everyone!
Can someone please tell me where i'm wrong ?
I don't understand why it's doesn't work.
package fr.codegym.task.task04.task0419;
/*
Le plus grand de quatre nombres
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//écris ton code ici
Scanner scanner = new Scanner(System.in);
int n1 = scanner.nextInt();
int n2 = scanner.nextInt();
int n3 = scanner.nextInt();
int n4 = scanner.nextInt();
int max = n1;
if (n2>= max){
max = n2;
if (n3 >= max){
n3 = max;
if (n4 >= max){
n4 = max;
}
else;
}
}
else {
if (n3 >= max)
max = n3;
else {
if (n4 >= max)
max = n4;
else;
}
}
System.out.println(max);
}
}