Vla_DOS

Untitled

Jan 30th, 2023
787
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 <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     double x = 1, y = 1, z;
  9.     const double e = 2.71828;
  10.     cout << "x, y =" << endl;
  11.     cin >> x >> y;
  12.     if (x < 0) {
  13.         y = x * x;
  14.     }
  15.     else if (x >= 0) {
  16.         y = pow(pow(e, cos(x)), 1 / 5.0);
  17.     }
  18.  
  19.     if (y < 0.2) {
  20.         z = 0.5 * x - pow(y, 3) + 1;
  21.     }
  22.     else if (x > 0.2) {
  23.         z = pow(y, 2) / (x - 0.4);
  24.     }
  25.     else {
  26.         z = (1 - pow(y, 2)) / pow(3, x);
  27.     }
  28.  
  29.     cout << "y = " << y << endl;
  30.     cout << "z = " << z << endl;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment