Ruma_Stoyanova

Point of figures

Feb 9th, 2017
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Point_of_Figures
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var h = int.Parse(Console.ReadLine());
  14. var x = int.Parse(Console.ReadLine());
  15. var y = int.Parse(Console.ReadLine());
  16. if((x>h)&&(x<2*h)&&(y==h))
  17. {
  18. Console.WriteLine("inside");
  19. }
  20. else if ((x >= h) && (x <= 2 * h)&&(y>=h)&&(y<=4*h))
  21. {
  22. if ((x > h) && (x < 2 * h) && (y > h) && (y < 4 * h))
  23. {
  24. Console.WriteLine("inside");
  25. }
  26. else if ((x >= h) && (x <= 2 * h) || (y >= h) && (y <= 4 * h))
  27. {
  28. Console.WriteLine("border");
  29. }
  30. else if((x>=0)&&(x<=3*h)&&(y>=0)&&(y<=h))
  31. {
  32. if ((x > 0) && (x < 3 * h) && (y > 0) && (y < h))
  33. {
  34. Console.WriteLine("inside");
  35. }
  36. else if ((x >= 0) && (x <= 3 * h) || (y >= 0) && (y <= h))
  37. {
  38. Console.WriteLine("border");
  39. }
  40. else
  41. {
  42. Console.WriteLine("outside");
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment