Advertisement
aggressiveviking

04.PointInFigure

Mar 4th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04.PointInFigure
  4. {
  5.     class PointInFigure
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int x = int.Parse(Console.ReadLine());
  10.             int y = int.Parse(Console.ReadLine());
  11.  
  12.             bool pointInRect1 = x >= 2 && x <= 12 && y >= -3 && y <= 1;
  13.             bool pointInRect2 = x >= 4 && x <= 10 && y >= -5 && y <= 3;
  14.  
  15.             if (pointInRect1 || pointInRect2)
  16.             {
  17.                 Console.WriteLine("in");
  18.             }
  19.             else
  20.             {
  21.                 Console.WriteLine("out");
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement