Laitofai

73

Dec 18th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double a, b, c, vid, poluperimetr, S;
  9.     cin>>a>>b>>c;
  10.     if(a*a<b*b+c*c||b*b<a*a+c*c||c*c<a*a+b*b){
  11.         if(a==b&&b==c)
  12.         {
  13.             vid=1;
  14.         }else{
  15.             if(a==b||b==c||c==a)
  16.                 {
  17.                     vid=2;
  18.                 }else{
  19.                     vid=3;}}
  20.         poluperimetr=(a+b+c)/2;
  21.         S=sqrt(poluperimetr*(poluperimetr-a)*(poluperimetr-b)*(poluperimetr-c));
  22.         cout<<S<<" "<<vid;
  23.     }else{cout<<"-1";}
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment