forked from gmendonca/uri-problem-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1043.cpp
More file actions
33 lines (25 loc) · 616 Bytes
/
1043.cpp
File metadata and controls
33 lines (25 loc) · 616 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
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
float a,b,c;
float mod1, mod2, mod3;
cin >> a >> b >> c;
if(b - c < 0)
mod1 = c - b;
else
mod1 = b - c;
if(b - a < 0)
mod2 = a - b;
else
mod2 = b - a;
if(a - c < 0)
mod3 = c - a;
else
mod3 = a - c;
if(mod1 < a && a < (b + c) && mod2 < c && c < (a+b) && mod3 < b && b < (a+c))
printf("Perimetro = %.1f\n", a+b+c);
else
printf("Area = %.1f\n", ((a+b)*c)/2.0);
return 0;
}