Advertisement
sivancheva

PointInFigure

May 2nd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7.  
  8. int h = int.Parse(Console.ReadLine());
  9. int x = int.Parse(Console.ReadLine());
  10. int y = int.Parse(Console.ReadLine());
  11. var inside = (((x > 0) && (x<3*h)) && ((y>0)&& (y<h)) && ((x>h) && (x<2*h)) && ((y>h) && (y<4*h)));
  12. var outside = (((x < 0) && (x>3*h)) && ((y<0)&& (y>h)) && ((x<h) && (x>2*h)) && ((y<h) && (y>4*h)));
  13.  
  14. if (inside)
  15.  
  16. {
  17. Console.WriteLine("inside");
  18. }
  19. else if (outside)
  20.  
  21. {
  22. Console.WriteLine("inside");
  23. }
  24. else
  25.  
  26. Console.WriteLine("border");
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement