Advertisement
Dr_Kryakowski

Lab 2.2

Feb 25th, 2020
105
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. #include <math.h>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     float x, a, ax, q;
  9.     cout << "Prosze podac znaczenia dla zmiennych 'x' ta 'a' przez spacja\n";
  10.     cin >> x >> a;
  11.     ax = x * a;
  12.     if (ax < -15.0)
  13.     {
  14.         q = pow(a, 3.0) + log(1 + abs(x));
  15.     }
  16.     if (-15.0 <= ax <= -5.0)
  17.     {
  18.         q = sqrt(a + sin(pow(a, 2.0) * x));
  19.     }
  20.     if (-5.0 < ax < 0)
  21.     {
  22.         q = 1 + a * (cos(pow(x, 3.0) / sin(pow(x, 3.0))));
  23.     }
  24.     if (ax > 15.0)
  25.     {
  26.         q = round(pow(a, 3.0) + log(1 + abs(x)));
  27.     }
  28.     cout << "Znaczennia q = " << q << endl;
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement