-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBeeCrowd1045.java
56 lines (47 loc) · 1.35 KB
/
BeeCrowd1045.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.util.Scanner;
// Problem URL: https://www.beecrowd.com.br/judge/en/problems/view/1045
// Last access 18 September 2022
// Visit my GitHub repository @ https://github.com/skan90
public class BeeCrowd1045 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double a = input.nextDouble();
double b = input.nextDouble();
double c = input.nextDouble();
double d = 0;
if (b >= c && b >= a) {
d = a;
a = b;
b = d;
}
if (c >= a && c >= b) {
d = a;
a = c;
c = d;
}
double aSquared = Math.pow(a, 2);
double bSquared = Math.pow(b, 2);
double cSquared = Math.pow(c, 2);
double bPlusC = b + c;
if (a >= bPlusC) {
System.out.println("NAO FORMA TRIANGULO");
} else {
if (aSquared == (bSquared + cSquared)) {
System.out.println("TRIANGULO RETANGULO");
}
if (aSquared > (bSquared + cSquared)) {
System.out.println("TRIANGULO OBTUSANGULO");
}
if (aSquared < (bSquared + cSquared)) {
System.out.println("TRIANGULO ACUTANGULO");
}
if (a == b && a == c) {
System.out.println("TRIANGULO EQUILATERO");
}
if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a)) {
System.out.println("TRIANGULO ISOSCELES");
}
}
input.close();
}
}