Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(0, "");
- float x, y, z1, z2;
- cout << "Введите x:";
- cin >> x;
- cout << "Введите y:";
- cin >> y;
- z1 = 0;
- z2 = 0;
- if (y <= -2){
- z1 = 4;
- }
- else if (y <= 0){
- z1 = 3;
- }
- else if (x >= y){
- z1 = 3;
- }
- else if (x < y) {
- if (x >= (y-2)){
- z1 = 1;
- }
- else {
- z1 = 2;
- }
- }
- if (y <= -2){
- z2 = 4;
- }
- if (((y <= 0) || (x >= y)) && (y>-2)){
- z2 = 3;
- }
- if ((x >= (y-2)) && (y>0) && (x<y)){
- z2 = 1;
- }
- if ((y>0) && (x<(y - 2))){
- z2 = 2;
- }
- cout << "Область1:" << z1 << endl;
- cout << "Область2:" << z2 << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement