-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1045.cpp
More file actions
58 lines (43 loc) · 995 Bytes
/
1045.cpp
File metadata and controls
58 lines (43 loc) · 995 Bytes
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
57
58
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
double a, b, c, aux;
cin >> a >> b >> c;
if (c > b) {
aux = c;
c = b;
b = aux;
}
if (b > a) {
aux = b;
b = a;
a = aux;
}
if ( c > b) {
aux = c;
c = b;
b = aux;
}
//TIPOS DE TRIÂNGULO A PARTIR DAQUI
if ( a >= b+c) {
cout << "NAO FORMA TRIANGULO" << endl;
}
else if ( (pow(a,2)) == (pow(b,2)) + (pow(c,2))) {
cout << "TRIANGULO RETANGULO" << endl;
}
else if ( (pow(a,2)) > (pow(b,2)) + (pow(c,2)) ) {
cout << "TRIANGULO OBTUSANGULO" << endl;
}
else if ( (pow(a,2)) < (pow(b,2)) + (pow(c,2))) {
cout << "TRIANGULO ACUTANGULO" << endl;
}
if ( a == b and a == c) {
cout << "TRIANGULO EQUILATERO" << endl;
}
else if ( a == b or b == c or a == c) {
cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}