Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Scanner scanner = new Scanner(System.in);
  2. int sideA = Integer.parseInt(scanner.nextLine());
  3. int sideB = Integer.parseInt(scanner.nextLine());
  4. int sideC = Integer.parseInt(scanner.nextLine());
  5. if(sideA>0 && sideB>0 && sideC>0) {
  6. if ((sideA + sideB > sideC) && (sideB + sideC > sideA) && (sideA + sideC > sideB))
  7. System.out.println("Valid Triangle");
  8. else {
  9. System.out.println("Invalid Triangle");
  10. }
  11. } else {
  12. System.out.println("Invalid Triangle");
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement