Any way the sum of any three sides will always be greater than the third side (except 0,0,0). I am unable to frame the logic on my last validation. Please help?
package com.codegym.task.task04.task0415;
/*
Rule of the triangle
*/
//import com.sun.deploy.security.SelectableSecurityManager;
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String s1 = bufferedReader.readLine();
String s2 = bufferedReader.readLine();
String s3 = bufferedReader.readLine();
int l1 = Integer.parseInt(s1);
int l2 = Integer.parseInt(s2);
int l3 = Integer.parseInt(s3);
if (l1+l2 > l3 )
{
System.out.println("The triangle is possible.");
}
else
{
if ( l2 + l3 > l1)
{
System.out.println("The triangle is possible.");
}
else
{
if ( l3 + l1 > l2 )
{
System.out.println("The triangle is possible.");
}
else
{
System.out.println("The triangle is not possible.");
}
}
}
}
}