Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
77
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. using namespace std;
  3. int main()
  4. {
  5.     int n, t, j;
  6.     double h, b, a, x, f, min, max;
  7.     cout << "enter n = ";
  8.     cin >> n;
  9.     cout << "enter h = ";
  10.     cin >> h;
  11.     cout << "enter b = ";
  12.     cin >> b;
  13.     for (t = 1;t <= 3;t++)
  14.     {
  15.         cout << "enter a" << t << " = ";
  16.         cin >> a;
  17.         j = 1;
  18.         x = b + j * h;
  19.         f = ((1 - a) / (1 + x * x))*sin(a*a + a * x + 2);
  20.         min = f;
  21.         max = f;
  22.         for (j = 2;j <= n;j++)
  23.         {
  24.             x = b + j * h;
  25.             f = ((1 - a) / (1 + x * x))*sin(a*a + a * x + 2);
  26.             if (f < min)
  27.                 min = f;
  28.             if (f > max)
  29.                 max = f;
  30.         }
  31.         cout << "fi = " << min << endl;
  32.         cout << "psi = " << max << endl;
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement