Aleksandr_Grigoryev

HW 8a

Dec 6th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>;
  2. #include <cmath>;
  3. #define PI 3.14159265  
  4. using namespace std;
  5. double STORONA(int a, int b, double alpha,double &result)
  6. {
  7.     result = sqrt(a*a + b*a - 0.5*a*b*cos(alpha*PI/180));
  8.     return result;
  9. }
  10. int main()
  11. {
  12.     int a, b;
  13.     double alpha, c;
  14.     cout << "Enter a,b,alpha";
  15.     cin >> a >> b >> alpha;
  16.     c=STORONA(a, b, alpha, c);
  17.     cout << "c=" << c;
  18.  
  19.  
  20.     system("pause");
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment