Advertisement
Guest User

g

a guest
Nov 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cmath>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     setlocale(LC_ALL, "Russian");
  10.     int n = 10;
  11.     double x, y, a, b, delta;
  12.     cout << "Введите a и b" << endl;
  13.     cin >> a >> b;
  14.     x = a;
  15.     cout << endl;
  16.     cout << setw(12) << 'x' << ' ' << setw(12) << 'y' << endl;
  17.     delta = (b - a) / (n - 1);
  18.     while (x <= b) {
  19.         if (x > 0) {
  20.             y = ((sqrt(1 + (pow(x, 2))) + (abs(pow(log(x), 3)) / (1.6 + pow(x, 4))))*sin(7 * x));
  21.             cout << setw(12) << x << ' ' << setw(12) << y << endl; 
  22.         }
  23.         else {
  24.             cout << setw(12) << x << ' ' << setw(12) << "NaN" << endl;
  25.         }
  26.         x += delta;
  27.     }
  28.     system("pause");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement