Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "russian");
- double x, y;
- cout << "Введите х: ";
- cin >> x;
- cout << "\nx = " << x;
- if (x <= -2)
- y = 0;
- else if (x <= 0)
- y = x * x - 4;
- else if (x <= 2)
- y = x * 2 - 4;
- else y = 0;
- cout << "\ny = "<< y;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement