Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <math.h>
  3. int main()
  4. {
  5. double x, y, f, a, s;
  6. int k;
  7. cout << "Vvedite x ";
  8. cin >> x;
  9. cout << "Vvedite y ";
  10. cin >> y;
  11. cout << "Viberite f: 1 - sh(x), 2 - x^2, 3 – exp(x) ";
  12. cin >> k;
  13. switch (k)
  14. { case 1: f = sinh(x);
  15. break; case 2: f = pow(x, 1/3.);
  16. break; case 3: f = exp(x);
  17. break;
  18. default: cout << "Ne vuibrana funkciya ";
  19. return 1;
  20. }
  21. a = (x * y);
  22. if (a <= 10 && a > 0.5) s = exp(f - fabs(y));
  23. else if (a <= 0.5 && a > 0.1) s = pow(fabs(f+y),1/3.);
  24. else s = 2*pow(f,2);
  25. cout << "RESULT = " << s << endl;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement