Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 5, 2020 18:57
Show Gist options
  • Save kryvoboker/d6a5e2bdecaf53f520e407428652bb6b to your computer and use it in GitHub Desktop.
Save kryvoboker/d6a5e2bdecaf53f520e407428652bb6b to your computer and use it in GitHub Desktop.
HomeWork3
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Input a");
int a = sc.nextInt();
System.out.println("Input b");
int b = sc.nextInt();
System.out.println("Input c");
int c = sc.nextInt();
if ((a + b > c) && (b + c > a) && (a + c > b)) {
System.out.println("There is a triangle");
}
else {
System.out.println("No triangle");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment