Advertisement
Vickyyy01

Inside The Building - my solution

Oct 30th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.19 KB | None | 0 0
  1. using System;
  2.  
  3. public class Test
  4. {
  5.         public static void Main()
  6.         {
  7.                 int h = int.Parse(Console.ReadLine());
  8.                 int x1 = int.Parse(Console.ReadLine());
  9.                 int y1 = int.Parse(Console.ReadLine());
  10.                 int x2 = int.Parse(Console.ReadLine());
  11.                 int y2 = int.Parse(Console.ReadLine());
  12.                 int x3 = int.Parse(Console.ReadLine());
  13.                 int y3 = int.Parse(Console.ReadLine());
  14.                 int x4 = int.Parse(Console.ReadLine());
  15.                 int y4 = int.Parse(Console.ReadLine());
  16.                 int x5 = int.Parse(Console.ReadLine());
  17.                 int y5 = int.Parse(Console.ReadLine());
  18.                
  19.                 if(y1 >= 0 && y1 <= h)
  20.                 {
  21.                         if(x1 >= 0 && x1 <= 3*h)
  22.                         {
  23.                                 Console.WriteLine("inside");
  24.                         }
  25.                         else
  26.                         {
  27.                                 Console.WriteLine("outside");
  28.                         }
  29.                 }
  30.                 else if (y1 >= h && y1 <= 4*h)
  31.                 {
  32.                         if(x1 >= h && x1 <= 2*h)
  33.                         {
  34.                                 Console.WriteLine("inside");
  35.                         }
  36.                         else
  37.                         {
  38.                                 Console.WriteLine("outside");
  39.                         }
  40.                 }
  41.                 else
  42.                 {
  43.                      Console.WriteLine("outside");
  44.                 }
  45.                
  46.                 if(y2 >= 0 && y2 <= h)
  47.                 {
  48.                         if(x2 >= 0 && x2 <= 3*h)
  49.                         {
  50.                                 Console.WriteLine("inside");
  51.                         }
  52.                         else
  53.                         {
  54.                                 Console.WriteLine("outside");
  55.                         }
  56.                 }
  57.                 else if (y2 >= h && y2 <= 4*h)
  58.                 {
  59.                         if(x2 >= h && x2 <= 2*h)
  60.                         {
  61.                                 Console.WriteLine("inside");
  62.                         }
  63.                         else
  64.                         {
  65.                                 Console.WriteLine("outside");
  66.                         }
  67.                 }
  68.                 else
  69.                 {
  70.                      Console.WriteLine("outside");
  71.                 }
  72.                
  73.                 if(y3 >= 0 && y3 <= h)
  74.                 {
  75.                         if(x3 >= 0 && x3 <= 3*h)
  76.                         {
  77.                                 Console.WriteLine("inside");
  78.                         }
  79.                         else
  80.                         {
  81.                                 Console.WriteLine("outside");
  82.                         }
  83.                 }
  84.                 else if (y3 >= h && y3 <= 4*h)
  85.                 {
  86.                         if(x3 >= h && x3 <= 2*h)
  87.                         {
  88.                                 Console.WriteLine("inside");
  89.                         }
  90.                         else
  91.                         {
  92.                                 Console.WriteLine("outside");
  93.                         }
  94.                 }
  95.                 else
  96.                 {
  97.                      Console.WriteLine("outside");
  98.                 }
  99.                
  100.                 if(y4 >= 0 && y4 <= h)
  101.                 {
  102.                         if(x4 >= 0 && x4 <= 3*h)
  103.                         {
  104.                                 Console.WriteLine("inside");
  105.                         }
  106.                         else
  107.                         {
  108.                                 Console.WriteLine("outside");
  109.                         }
  110.                 }
  111.                 else if (y4 >= h && y4 <= 4*h)
  112.                 {
  113.                         if(x4 >= h && x4 <= 2*h)
  114.                         {
  115.                                 Console.WriteLine("inside");
  116.                         }
  117.                         else
  118.                         {
  119.                                 Console.WriteLine("outside");
  120.                         }
  121.                 }
  122.                 else
  123.                 {
  124.                      Console.WriteLine("outside");
  125.                 }
  126.                
  127.                 if(y5 >= 0 && y5 <= h)
  128.                 {
  129.                         if(x5 >= 0 && x5 <= 3*h)
  130.                         {
  131.                                 Console.WriteLine("inside");
  132.                         }
  133.                         else
  134.                         {
  135.                                 Console.WriteLine("outside");
  136.                         }
  137.                 }
  138.                 else if (y5 >= h && y5 <= 4*h)
  139.                 {
  140.                         if(x5 >= h && x5 <= 2*h)
  141.                         {
  142.                                 Console.WriteLine("inside");
  143.                         }
  144.                         else
  145.                         {
  146.                                 Console.WriteLine("outside");
  147.                         }
  148.                 }
  149.                 else
  150.                 {
  151.                      Console.WriteLine("outside");
  152.                 }
  153.         }
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement