I've been racking my head for 30 minutes trying to find a combination which fails this Solution.
Could someone please give me a hint as to where I went wrong?
Thanks so much!
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int d = Integer.parseInt(reader.readLine());
if (a >= b){
if (a >= c){
if (a >= d)
System.out.println(a);
else
System.out.println(d);
}
else if (c >= d){
System.out.println(c);
if (d > c)
System.out.println(d);
}
}
else if (b >= c){
if (b >= d)
System.out.println(b);
else
System.out.println(d);
}
else if (c >= d){
System.out.println(c);
if (d > c)
System.out.println(d);
}
}
}