Advertisement
istomina_sofia

График(попадает в область или нет)

Jun 25th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<clocale>
  4. using namespace std;
  5. int main()
  6. {
  7.     setlocale(0, "RUS");
  8.     float x, y;
  9.     cin >> x >> y;
  10.     if (0 <= y <= 1 && -y <= x <= y || -1 <= y <= 0 && y <= x <= -y)
  11.     {
  12.         cout << "Попадает в необходимую область" << endl;
  13.     }
  14.     else
  15.     {
  16.         cout << "Не попадает в необходимую область" << endl;
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement