Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <Windows.h>
- #include <cmath>
- #include <conio.h>
- using namespace std;
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- float x, d, F;
- int N,A,B;
- do
- {
- cout << "Введите значение A: " << endl;
- cin >> A;
- cout << "Введите значение B: " << endl;
- cin >> B;
- if (A == B) cout << "A не должно быть равным B, введите новые значения" << endl;
- } while (A == B);
- cout << "Введите количество элементов N:" << endl;
- do
- {
- cin >> N;
- if (N <= 2) cout << "Количество элементов должно быть больше 2, введите новое значение" << endl;
- } while (N <= 2);
- x = A;
- d = (B - A) / (N - 1);
- while (x <= B)
- {
- if (x != - M_PI / 4.0 + M_PI )
- {
- F = (1.0/4.0 - x * x * tan(x)) / (sin(x) + cos(x));
- cout << setw(15) << left << x << F << endl;
- }
- x = x + d;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement