rishat06

2_var8

Sep 22nd, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     double x, n;
  7.     const double pi = acos(-1.0);
  8.    
  9.     cout << "Введите x: ";
  10.     cin >> x;
  11.    
  12.     if (x > 5) {
  13.         n = cos(pi/2 + pi*x);
  14.     }
  15.     else if (x > 2) {
  16.         n = 0.5 + x*x*x;
  17.     }
  18.     else {
  19.         n = 2.0/(x - 3) + sqrt(x + 1);
  20.     }
  21.    
  22.     cout << "n = " << n << endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment