Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. #include <iostream>
  3.  
  4. using namespace std;
  5. int _tmain(int argc, _TCHAR* argv[])
  6. {
  7.     setlocale(0, "");
  8.     float x, y, z1, z2;
  9.     cout << "Введите x:";
  10.     cin >> x;
  11.     cout << "Введите y:";
  12.     cin >> y;
  13.     z1 = 0;
  14.     z2 = 0;
  15.     if (y <= -2){
  16.         z1 = 4;
  17.     }
  18.     else if (y <= 0){
  19.         z1 = 3;
  20.     }
  21.     else if (x >= y){
  22.         z1 = 3;
  23.     }
  24.     else if (x < y) {
  25.         if (x >= (y-2)){
  26.             z1 = 1;
  27.         }
  28.         else {
  29.             z1 = 2;
  30.         }
  31.  
  32.     }
  33.     if (y <= -2){
  34.         z2 = 4;
  35.     }
  36.     if (((y <= 0) || (x >= y)) && (y>-2)){
  37.         z2 = 3;
  38.     }
  39.     if ((x >= (y-2)) && (y>0) && (x<y)){
  40.         z2 = 1;
  41.     }
  42.     if ((y>0) && (x<(y - 2))){
  43.         z2 = 2;
  44.     }
  45.     cout << "Область1:" << z1 << endl;
  46.     cout << "Область2:" << z2 << endl;
  47.     system("pause");
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement