Risonna

lab1_n5

Oct 30th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #define pi acos(-1.0)
  4. using namespace std;
  5. int main()
  6. {
  7.     float a, om, x, eps, y;
  8.     cout << "Введите a: "; cin >> a;
  9.     cout << "Введите Омега: "; cin >> om;
  10.     cout << "Введите Эпсилон: "; cin >> eps;
  11.     cout << "Введите x:"; cin >> x;
  12.     if (2 - eps != 0 && sin(om*x) <=1 && sin(om*x)>=-1)
  13.     {
  14.         x = (pi / 2 - eps);
  15.         y = a * exp(-a * om * x) * sin(om * x);
  16.         cout << "y = " << y << endl;
  17.     }
  18.     else { cout << "2-eps=0"; }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment