Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- using namespace std;
- void f(float x) {
- float i = 0.1;
- if (x < 0) {
- cout << "равна" << " " << 0.2*pow(x, 2) - x - i << endl;
- }
- else if (x > 0 && x != i) {
- cout << "равна" << " " << (pow(x, 2)) / (x - i) << endl;
- }
- else {
- cout << "равна" << " " << "0" << endl;
- }
- }
- int main() {
- setlocale(LC_ALL, "Russian");
- float a, b, h;
- cout << "Введите a: ";
- cin >> a;
- cout << "Введите b: ";
- cin >> b;
- cout << "Введите h: ";
- cin >> h;
- for (a; a <= b; a += h) {
- cout << "Для x = " << a << " " << "Функция" << " ";
- f(a);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement