Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- double x;
- cout << "Введите действительное число x: ";
- cin >> x;
- double result;
- if (x <= -2.0) {
- result = 0.0;
- } else if (x <= 0.0) {
- result = x*x + 4.0*x + 5.0;
- } else {
- result = 1.0/(x*x + 4.0*x - 5.0);
- }
- cout << "f(x) = " << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment