-
Notifications
You must be signed in to change notification settings - Fork 0
/
1045.cpp
30 lines (25 loc) · 885 Bytes
/
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
#include <stdio.h>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
float a,b,c;
vector<float> v;
scanf("%f %f %f", &a, &b, &c);
v.push_back(a);
v.push_back(b);
v.push_back(c);
sort(v.begin(), v.end());
reverse(v.begin(), v.end());
if (v.at(0) >= v.at(1) + v.at(2)) printf("NAO FORMA TRIANGULO\n");
else{
if (pow(v.at(0), 2) == (pow(v.at(1), 2) + pow(v.at(2), 2))) printf("TRIANGULO RETANGULO\n");
if (pow(v.at(0), 2) > (pow(v.at(1), 2) + pow(v.at(2), 2))) printf("TRIANGULO OBTUSANGULO\n");
if (pow(v.at(0), 2) < (pow(v.at(1), 2) + pow(v.at(2), 2))) printf("TRIANGULO ACUTANGULO\n");
if (v.at(0) == v.at(1) && v.at(1) == v.at(2)) printf("TRIANGULO EQUILATERO\n");
else if (v.at(0) == v.at(1) || v.at(1) == v.at(2) || v.at(0) == v.at(2)) printf("TRIANGULO ISOSCELES\n");
}
return 0;
}