Kentoo

N#2

Dec 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <cmath>
  5. #include <Windows.h>
  6. #include <locale>
  7. #include <math.h>
  8. #include <conio.h>
  9.  
  10. using namespace std;
  11. void main()
  12. {
  13.     setlocale(LC_ALL, "Russian");
  14.     double A, B, N, shag, y, x;
  15.     cout << endl;
  16.     cout << "Введите значения А, B" << endl;
  17.     cout << endl;
  18.     do cin >> A >> B;
  19.     while (A == B);
  20.     cout << endl;
  21.     cout << "Введите значениe N" << endl;
  22.     cout << endl;
  23.     do cin >> N;
  24.     while (N < 2.0);
  25.     cout << endl;
  26.     cout << setw(15) << "Значение x: " << setw(15) << "Значение y: " << endl;
  27.     shag = (B - A) / (N - 1.0);
  28.     for (x = A; x <= B; x = x + shag)
  29.     {
  30.         if (x >= 0)
  31.         {
  32.             y = 1.0 / 3.0 * pow(exp(6.3 + sqrt(x)), 1.0 / 7.0) * abs(cos(2.0 * x / 3.0) - x);
  33.             cout << setw(15)  << x << setw(15) << y << endl;
  34.         }
  35.         else cout << setw(15) << x << setw(15) << "не существует " << endl;
  36.     }
  37.     _getch();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment