I know that my solution isnt the most elegant; I've tried a number of ways that failed to verify. So now I've decided to take a longer route. I am sure what's wrong please help. The last requirement fails where all others pass.
package com.codegym.task.task04.task0415;
/*
Rule of the triangle
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
String a = reader.readLine();
int a1 = Integer.parseInt(a);
String b = reader.readLine();
int b1 = Integer.parseInt(b);
String c = reader.readLine();
int c1 = Integer.parseInt(c);
if (a1 + b1 > c1)
System.out.println("The triangle is possible.");
else if (c1 >= a1+ b1)
System.out.println("The triangle is not possible.");
else if (b1 + c1 > a1)
System.out.println("The triangle is possible.");
else if (a1 >= b1 + c1)
System.out.println("The triangle is not possible.");
else if (c1 + a1 > b1 )
System.out.println("The triangle is possible.");
else if (b1 >= c1 + a1)
System.out.println("The triangle is not possible.");
}
}