-
Notifications
You must be signed in to change notification settings - Fork 0
/
Triangle Types.cpp
54 lines (53 loc) · 1.18 KB
/
Triangle Types.cpp
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
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x,y,z,a,b,c;
cin >> x >> y >> z;
double m[3] = {x,y,z} ;
sort(m,m+3);
c = m[0];
b = m[1];
a = m[2];
if(a>=(b+c))
{
cout << "NAO FORMA TRIANGULO" << endl ;
}
else if(a*a == (b*b + c*c))
{
cout << "TRIANGULO RETANGULO" << endl ;
if(a==b && b==c && c==a)
{
cout << "TRIANGULO EQUILATERO" << endl ;
}
else if(a==b || b==c || c==a)
{
cout << "TRIANGULO ISOSCELES" << endl ;
}
}
else if(a*a > (b*b + c*c))
{
cout << "TRIANGULO OBTUSANGULO" << endl ;
if(a==b && b==c && c==a)
{
cout << "TRIANGULO EQUILATERO" << endl ;
}
else if(a==b || b==c || c==a)
{
cout << "TRIANGULO ISOSCELES" << endl ;
}
}
else if(a*a < (b*b + c*c))
{
cout << "TRIANGULO ACUTANGULO" << endl ;
if(a==b && b==c && c==a)
{
cout << "TRIANGULO EQUILATERO" << endl ;
}
else if(a==b || b==c || c==a)
{
cout << "TRIANGULO ISOSCELES" << endl ;
}
}
return 0;
}