Advertisement
plamen27

Point in Figure Fixed

Jul 7th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4. static void Main()
  5. {
  6. int h = int.Parse(Console.ReadLine());
  7. int x = int.Parse(Console.ReadLine());
  8. int y = int.Parse(Console.ReadLine());
  9. ////////////////////////////////////////////////////////////////////////////////////////////////
  10. if ((x >= (2 * h)) && (x < (3 * h)) && (y > 0) && (y < h)
  11. || x > h && x < 2 * h && y > 0 && y < 4 * h || (x > 0) && (x <= h) && (y > 0) && (y < h))
  12. ////////////////////////////////////////////////////////////////////////////////////////////////
  13.  
  14. {
  15. Console.WriteLine("inside");
  16. }
  17. else if (x >= 0 && y == 0 && x <= 3 * h
  18. || x >= 0 && y == h && x <= h
  19. || x >= 2 * h && y == h && x <= 3 * h //// тук имаше грешка: &&
  20. || x >= h && y == 4 * h && x <= 2 * h
  21. || y >= 0 && x == 0 && y <= h
  22. || y >= h && x == h && y <= 4 * h
  23. || y >= h && x == 2 * h && y <= 4 * h
  24. || y >= 0 && x == 3 * h && y <= h)
  25. {
  26. Console.WriteLine("border");
  27. }
  28. else
  29. {
  30. Console.WriteLine("outside");
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement