Advertisement
VictoriaLodochkina

lab 9 z2

Nov 21st, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. double max(double, double, double);
  4. int main()
  5. {
  6.     using namespace std;
  7.     cout << "Enter a, b, c: " << endl;
  8.     double a, b, c;
  9.     cin >> a >> b >> c;
  10.     cout << "Your result: " << max((a * a + b) / (2 * a * b * b), (b * b - a * c) / (c + 2 * b), (c * a) / (a + sqrt(b))) + max((a - pow(b, 1.0 / c)) / b, (pow(a, b) - pow(b, c)) / (pow(pow(a, a) + c, 0.25)), 1.0 / a) << endl;
  11.     return 0;
  12. }
  13. double max(double x, double y, double z)
  14. {
  15.     double max1, max2;
  16.     if (x > y)
  17.     {
  18.         max1 = x;
  19.     }
  20.     else
  21.     {
  22.         max1 = y;
  23.     }
  24.     if (max1 > z)
  25.     {
  26.         max2 = max1;
  27.     }
  28.     else
  29.     {
  30.         max2 = z;
  31.     }
  32.     return max2;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement