Created
May 5, 2020 18:57
-
-
Save kryvoboker/d6a5e2bdecaf53f520e407428652bb6b to your computer and use it in GitHub Desktop.
HomeWork3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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