-
Notifications
You must be signed in to change notification settings - Fork 0
/
Selection2Exp2244107060006.java
33 lines (29 loc) · 1.2 KB
/
Selection2Exp2244107060006.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
public class Selection2Exp2244107060006 {
public static void main(String[] args) {
Scanner input244107060006 = new Scanner(System.in);
int angle1;
int angle2;
int angle3;
int totalAngle;
System.out.print("angle1: ");
angle1 = input244107060006.nextInt();
System.out.print("angle2: ");
angle2 = input244107060006.nextInt();
System.out.print("angle3: ");
angle3 = input244107060006.nextInt();
totalAngle = angle1 + angle2 + angle3;
if (totalAngle == 180 )
if (angle1==90 || angle2==90 || angle3==90)
System.out.println("Right triangle");
else if (angle1 + angle2 <= angle3 || angle1 + angle3 <= angle2 || angle2 + angle3 <= angle1) {
System.out.println("invalid triangle");
}
if (angle1 == angle2 && angle2 == angle3) {
System.out.println("Equilateral triangle");
}
else if (angle1 == angle2 || angle2 == angle3 || angle2 == angle3) {
System.out.println("isosceles triangle");
}
}
}