Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale>
- using namespace std;
- float f(float x) {
- if (x == 1 || x == -1)
- return 1;
- if (x >= 0 && x != 1)
- return -1 / (1 - x);
- if (x < 0 && x != -1)
- return 1 / (1 + x);
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << "Программа, которая строит таблицу значений функции УМЛ-111 Никульченков М.Е.\n";
- float a, b, h, x, z;
- cout << "a= ";
- cin >> a;
- cout << "b= ";
- cin >> b;
- cout << "h= ";
- cin >> h;
- cout << "x\tf(x)\n";
- for (x = a; x <= b; x += h) {
- cout << x << "\t";
- if (x == 1 || x == -1)
- z = 1;
- if (x >= 0 && x != 1)
- z = -1 / (1 - x);
- if (x < 0 && x != -1)
- z = 1 / (1 + x);
- cout << z << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment