kxcoze

lab2_??

Feb 26th, 2020
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include "bits/stdc++.h"    //универсальная библиотека для GNU-ских компиляторов
  2.    
  3. using namespace std;    
  4.  
  5. int main() {
  6.     setlocale(LC_ALL, "rus");
  7.     string ans = "YES";
  8.     double x, y;
  9.     cout << "Введите х: ";
  10.     cin >> x;
  11.  
  12.     if (x <= -3)
  13.         y = pow(log(x*x + 1), 3);
  14.     else if (x > 3)
  15.         y = atan(1 / (2*x + 1));
  16.     else
  17.         ans = "NO";
  18.  
  19.     if (ans == "YES")
  20.         cout << "y = " << y << '\n';
  21.     else
  22.         cout << "x не входит в ОДЗ" << '\n';
  23.      
  24.     system("pause");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment