-
Notifications
You must be signed in to change notification settings - Fork 0
/
URI_1045.cpp
61 lines (51 loc) · 1.01 KB
/
URI_1045.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
55
56
57
58
59
60
61
#include<iostream>
using namespace std;
int main()
{
double a[3];
for (int i = 0; i < 3; i++)
{
cin>>a[i];
}
double temp;
for (int i = 0; i < 3; i++)
{
for (int j = i+1; j < 3; j++)
{
if ( a[j] > a[i] )
{
temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
double A = a[0];
double B = a[1];
double C = a[2];
if ( A >= B + C )
{
cout<<("NAO FORMA TRIANGULO\n");
}
else if ( A*A > B*B + C*C )
{
cout<<("TRIANGULO OBTUSANGULO\n");
}
if ( A*A == B*B + C*C )
{
cout<<("TRIANGULO RETANGULO\n");
}
if ( A*A < B*B + C*C )
{
cout<<("TRIANGULO ACUTANGULO\n");
}
if ( A == B && B == C && A == C )
{
cout<<("TRIANGULO EQUILATERO\n");
}
if ( ((A == B) && (A!=C)) || (( A==C)&&(A!=B)) || ((B==C)&&(B!=A)) )
{
cout<<("TRIANGULO ISOSCELES\n");
}
return 0;
}