Advertisement
alaminrifat

URI -1043 with C++

Apr 11th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     float a,b,c,area,pre;
  7.     cin>>a>>b>>c;
  8.     cout.precision(1);
  9.     if((a+b)>c && (c+a)>b && (b+c)>a)
  10.     {
  11.         pre = a+b+c;
  12.         cout<<fixed<<"Perimetro = "<<pre<<endl;
  13.     }
  14.     else
  15.     {
  16.         area = ((a+b)/2)*c;
  17.         cout<<fixed<<"Area = "<<area<<endl;
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement