Выводит всё правильно, но выдает ошибку, в чем проблема?
package com.javarush.task.task04.task0419;
/*
Максимум четырех чисел
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
int c = s.nextInt();
int d = s.nextInt();
int max = a;
if (max < b){
max = b;
if (max < c)
max = c;
if (max < d)
max = d;
}
System.out.println(max);
}
}