Advertisement
MargaritaOwl

Tricut

May 14th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include<cstdlib>
  2. #include<time.h>
  3. #include<math.h>
  4. #include<iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     setlocale(LC_ALL,"rus");
  11.     float a,b,c;
  12.     cout<<"Введите стороны треугольника: "<<endl;
  13.     cout<<"a=";
  14.     cin>>a;
  15.  
  16.     cout<<"b=";
  17.     cin>>b;
  18.  
  19.     cout<<"c=";
  20.     cin>>c;
  21. if(a >= b + c || b >= a + c || c >= b + a) cout<<"Треугольник не существует"<<endl;  
  22.  else
  23.      if(a==b&&b==c&&c==a) cout<<"Треугольник равносторонний"<<endl;
  24.      else
  25.          if(a==b||b==c||c==a) cout<<"Треугольник равнобедренный"<<endl;
  26.      else
  27.   if(a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a) cout<<"Прямоугольный треугольник"<<endl;
  28.    else
  29.     if(a*a > b*b+c*c || b*b > a*a+c*c || c*c > b*b+a*a) cout<<"Тупоугольный треугольник"<<endl;
  30.       else
  31.        cout<<"Остроугольный треугольник"<<endl;
  32.     system("pause");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement