Advertisement
Usow_Maxim

ToFriends - Lab_1

Oct 27th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <stdio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     double pi = 3.14159265358979323846, a, b, u, c;
  10.  
  11.     cout << "Vedite dliny A" << endl;
  12.     cin >> a;
  13.     cout << "Vedite dliny B" << endl;
  14.     cin >> b;
  15.     cout << "Ygol mejdu A i B" << endl;
  16.     cin >> u;
  17.  
  18.     c = sqrt((a*a) + (b*b) - (2 * (a*b)*cos((u*pi) / 180)));
  19.  
  20.     printf("Ravnostorony-%d\n", (u == 60)? 1 : 0);
  21.     printf("Ravnobedreny-%d\n", ((a == b) || (b == c))? 1 : 0);
  22.     printf("Pryamoygolny-%d\n", (((a*a) + (b*b) == (c*c)) || ((c*c) + (a*a) == (b*b)) || ((c*c) + (b*b) == (a*a)))? 1 : 0);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement