Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace PointinFigure
  7. {
  8. class PointinFigure
  9. {
  10. static void Main(string[] args)
  11. {
  12. var h = int.Parse(Console.ReadLine());
  13. var x = int.Parse(Console.ReadLine());
  14. var y = int.Parse(Console.ReadLine());
  15.  
  16. var Inside = (x > 0 && x < (3 * h) && y > 0 && y < h) || (x > h && x < (2 * h) && y > h && y < (4 * h));
  17. var Outside = (x < 0 || x > (3 * h) && y < 0 || y > h) || (x < h || x > (2 * h) && y < h || y > (4 * h));
  18. var border = (x == 0 || y == 0) || (x == h) || (y == h && x <= 0 || x >= 3 * h) || (y == 4 * h && x >= h || x <= 2 * h) || (x == h && y >= h || y <= 4 * h) || (x == 2 * h && y >= h || y <= 4 * h);
  19.  
  20. if (y != 0 && Inside)
  21. {
  22. Console.WriteLine("inside");
  23. }
  24. else if (y != 0 && Outside)
  25. {
  26. Console.WriteLine("outside");
  27. }
  28. else if (border)
  29. {
  30. Console.WriteLine("border");
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement