Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
93
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.  
  3. #include <cmath>
  4.  
  5. int main()
  6.  
  7. {
  8.  
  9. double x, y, s, boof1, boof2;
  10.  
  11. int function;
  12.  
  13. std::cin >> x >> y; std::cout << std::endl;
  14.  
  15. std::cout << "select your function 1 - sh(x), 2 - x^2, 3 - e^x" << std::endl;
  16.  
  17. std::cin >> function;
  18.  
  19. switch(function){
  20.  
  21. case 1:boof1 = sinh(x); break;
  22.  
  23. case 2:boof1 = pow(x, 2); break;
  24.  
  25. case 3:boof1 = exp(x); break;
  26.  
  27. default: std::cout <<"error"<< std::endl;
  28.  
  29. return 0;
  30.  
  31. }
  32.  
  33. boof2=x*y;
  34.  
  35. if(0.5 < x*y && x*y < 10)
  36.  
  37. s = exp(boof2-fabs(y));
  38.  
  39. else if(0.1 < boof2 && boof2 < 0.5)
  40.  
  41. s = pow(boof2 + y, 1.0/0.3);
  42.  
  43. else
  44.  
  45. s=2*pow(boof2, 2);
  46.  
  47. std::cout << s;
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement