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 s1, s2, s, x, y;
- int res = 0;
- s1 = 3.14 * 3 * 3;
- s2 = 3.14 * 1.5 * 1.5;
- s = s1 - s2;
- cout << "Введите координаты точки (x, y): " << endl;
- cin >> x >> y;
- cout << "x = " << x << ", y =" << y << endl;
- if (((x >= -3 && x <=0 && y <= 0) || (x >= 0 && x <= 3 && y >= 0)) && (x * x + y * y > s2 / 2))
- res++;
- else if ((x >= -3 && x <= 0 && y >= 0) || (x >= 0 && x <= 3 && y <= 0))
- res++;
- if (res == 1)
- cout << "Площадь заштрихованной фигуры равна: " << s << endl;
- else
- cout << "Координаты не попадают в заштрихованную фигуру" << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement