BorislavBorisov

07.01.Inside The Building мое решение

Oct 11th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. class InsideTheBuilding
  3. {
  4.     static void Main()
  5.     {
  6.         int size = int.Parse(Console.ReadLine());
  7.  
  8.         for (int i = 0; i < 5; i++)
  9.         {
  10.             int X = int.Parse(Console.ReadLine());
  11.             int Y = int.Parse(Console.ReadLine());
  12.             IsInsidePoints(X, Y, size);
  13.         }
  14.     }
  15.     static void IsInsidePoints(int X, int Y, int h)
  16.     {
  17.         if (Y >= 0 && Y <= h * 4 && X >= h && X <= h * 2
  18.             || (Y >= 0 && Y <= h) && (X >= 0 && X <= h * 3))
  19.         {
  20.             Console.WriteLine("inside");
  21.         }
  22.         else
  23.         {
  24.             Console.WriteLine("outside");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment