Nikolay_Kashev

Точка във фигура

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