Advertisement
EvstatiZarkov

C# Exam April 2014 - InsideTheBuilding

Apr 16th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class InsideTheBuilding
  5. {
  6.     static void Main()
  7.     {
  8.         int h = int.Parse(Console.ReadLine());
  9.  
  10.  
  11.  
  12.         for (int i = 0; i < 5; i++)
  13.         {
  14.             int x = int.Parse(Console.ReadLine());
  15.             int y = int.Parse(Console.ReadLine());
  16.             Console.WriteLine(((x <= 3 * h && x >= 0) && (y >= 0 && y <= h)) || (y > h && y <= 4 * h) && (x >= h && x <= 2 * h) ? "inside" : "outside");
  17.         }
  18.  
  19.  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement