Advertisement
a1m

inside the building

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