BorisSimeonov

Inside The Building

Nov 7th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         int h = int.Parse(Console.ReadLine());
  8.         int[] xSpots = new int[10];
  9.         int[] ySpots = new int[10];
  10.         string[] results = new string[5];
  11.         for (int cnt = 0; cnt < 5; cnt++ )
  12.         {
  13.             xSpots[cnt] = int.Parse(Console.ReadLine());
  14.             ySpots[cnt] = int.Parse(Console.ReadLine());
  15.  
  16.             if ((xSpots[cnt] <= h * 3 && ySpots[cnt] <= h && xSpots[cnt] >= 0 && ySpots[cnt] >= 0) ||
  17.                 (xSpots[cnt] >= h && xSpots[cnt] <= h * 2 && ySpots[cnt] >= h && ySpots[cnt] <= h * 4))
  18.             {
  19.                 results[cnt] = "inside";
  20.             }
  21.             else
  22.             {
  23.                 results[cnt] = "outside";
  24.             }
  25.         }
  26.         //
  27.         foreach(string x in results)
  28.         {
  29.             Console.WriteLine(x);
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment