zh_stoqnov

InsideTheBuilding

Oct 30th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.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 Inside_the_Building
  8. {
  9. class InsideTheBuilding
  10. {
  11. static void Main(string[] args)
  12. {
  13. int h = int.Parse(Console.ReadLine());
  14. int x1 = int.Parse(Console.ReadLine());
  15. int y1 = int.Parse(Console.ReadLine());
  16. int x2 = int.Parse(Console.ReadLine());
  17. int y2 = int.Parse(Console.ReadLine());
  18. int x3 = int.Parse(Console.ReadLine());
  19. int y3 = int.Parse(Console.ReadLine());
  20. int x4 = int.Parse(Console.ReadLine());
  21. int y4 = int.Parse(Console.ReadLine());
  22. int x5 = int.Parse(Console.ReadLine());
  23. int y5 = int.Parse(Console.ReadLine());
  24. bool insideFirst = x1 >= 0 && x1 <= 3 * h && y1 <= h && y1 >= 0 || x1 >= h && x1 <= 2 * h && y1 >= h && y1 <= 4 * h;
  25. bool insideSecond = x2 >= 0 && x2 <= 3 * h && y2 <= h && y2 >= 0 || x2 >= h && x2 <= 2 * h && y2 >= h && y2 <= 4 * h;
  26. bool insideThird = x3 >= 0 && x3 <= 3 * h && y3 <= h && y3 >= 0 || x3 >= h && x3 <= 2 * h && y3 >= h && y3 <= 4 * h;
  27. bool insideFourth = x4 >= 0 && x4 <= 3 * h && y4 <= h && y4 >= 0 || x4 >= h && x4 <= 2 * h && y4 >= h && y4 <= 4 * h;
  28. bool insideFifth = x5 >= 0 && x5 <= 3 * h && y5 <= h && y5 >= 0 || x5 >= h && x5 <= 2 * h && y5 >= h && y5 <= 4 * h;
  29. if (insideFirst && true)
  30. {
  31. Console.WriteLine("inside");
  32. }
  33. else
  34. {
  35. Console.WriteLine("outside");
  36. }
  37. if (insideSecond && true)
  38. {
  39. Console.WriteLine("inside");
  40. }
  41. else
  42. {
  43. Console.WriteLine("outside");
  44. }
  45. if (insideThird && true)
  46. {
  47. Console.WriteLine("inside");
  48. }
  49. else
  50. {
  51. Console.WriteLine("outside");
  52. }
  53. if (insideFourth && true)
  54. {
  55. Console.WriteLine("inside");
  56. }
  57. else
  58. {
  59. Console.WriteLine("outside");
  60. }
  61. if (insideFifth && true)
  62. {
  63. Console.WriteLine("inside");
  64. }
  65. else
  66. {
  67. Console.WriteLine("outside");
  68. }
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment