SHARE
TWEET

Exam Problem2

a guest Apr 21st, 2015 202 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class InsideTheBuilding
  4. {
  5.     static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         int[] x = new int[5];
  9.         int[] y = new int[5];
  10.  
  11.         for (int i = 0; i < 5; i++)
  12.         {
  13.             Console.WriteLine("Type x{0} and y{0}", i + 1);
  14.  
  15.             x[i] = int.Parse(Console.ReadLine());
  16.             y[i] = int.Parse(Console.ReadLine());
  17.  
  18.             if ((x[i] >= 1 * n && x[i] <= 2 * n && y[i] >= 0 && y[i] <= 4 * n) || (x[i] >= 0 && x[i] <= 3 * n && y[i] >= 0 && y[i] <= 1 * n))
  19.             {
  20.                 Console.WriteLine("Inside!");
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine("Outside !");
  25.             }
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top