Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. class InsideTheBuilding
  4. {
  5. static void Main()
  6. {
  7. //input -1000 to 1000
  8.  
  9. int h = int.Parse(Console.ReadLine());
  10. int [] x = new int[5];
  11. int [] y = new int[5];
  12. for (int i = 0; i < 5; i++)
  13. {
  14. x[i] = int.Parse(Console.ReadLine());
  15. y[i] = int.Parse(Console.ReadLine());
  16.  
  17. if (x[i] >=0 && x[i]<= h && y[i]>=0 && y[i]<=h)
  18. {
  19. Console.WriteLine("inside");
  20. }
  21.  
  22. else if(x[i]>=h && x[i]<= 2*h && y[i] >=0 && y[i]<=4*h)
  23. {
  24. Console.WriteLine("inside");
  25. }
  26. else if (x[i]>=2*h && x[i]<=3*h && y[i]>=0 && y[i]<=h)
  27. {
  28. Console.WriteLine("inside");
  29. }
  30. else
  31. {
  32. Console.WriteLine("outside");
  33. }
  34.  
  35. }
  36. Console.ReadLine();
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement