Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- bool a(int x, int y) {
- return ((y <= -x + 1) && (y <= x + 1) && (y >= x - 1) && (y >= -x - 1));
- }
- bool b(int x, int y) {
- return ((y <= exp(x)) && (y <= (exp(-x))) && (y >= pow(x, 2) - 1));
- }
- bool c(int x, int y) {
- return (((x <= -2) || (x >= 2)) && (y >= 2) || ((x < 2) && (x > -2)) && (y >= abs(x)));
- }
- bool d(int x, int y) {
- return (((y >= 0) && (pow(x, 2) + pow(y, 2) >= 2.25) && (pow(x, 2) + pow(y, 2) <= 9)) || ((y <= 0) && (pow(x, 2) + pow(y, 2) < 9)));
- }
- bool e(int x, int y) {
- return ((y >= 0) && (y >= x) && (y >= -2 * x) && (pow(x, 2) + pow(y, 2) <= 4));
- }
- string resultEnterpreter(bool x) {
- if (x) {
- return "Включена";
- }
- else {
- return "Не включена";
- }
- }
- int main() {
- setlocale(LC_ALL, "Russian");
- int x; int y;
- cout << "Введите x,y для проверки с 'а' по 'д'" << endl;
- cin >> x;
- cin >> y;
- cout << "A: " << resultEnterpreter(a(x, y)) << endl;
- cout << "Б: " << resultEnterpreter(b(x, y)) << endl;
- cout << "В: " << resultEnterpreter(c(x, y)) << endl;
- cout << "Г: " << resultEnterpreter(d(x, y)) << endl;
- cout << "Д: " << resultEnterpreter(e(x, y)) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement