Advertisement
Pazzobg

Programming Basics / 4.Complex-Conditions / 13.PointInFigure

Feb 9th, 2017
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _13.PointInTheFigure
  4. {
  5.     class PointInFigure
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int h = int.Parse(Console.ReadLine());
  10.             double x = double.Parse(Console.ReadLine());
  11.             double y = double.Parse(Console.ReadLine());
  12.  
  13.             if ((x > 0 && x < 3*h && y > 0 && y < h) || (x > h && x < 2 * h && y > h && y < 4 * h) || (y == h && x > h && x < 2 * h) )
  14.             {
  15.                 Console.WriteLine("inside");
  16.             }
  17.             else if ((x < 0 || x > 3 * h || y < 0 || y > h) && (x < h || x > 2 * h || y < h || y > 4 * h))
  18.             {
  19.                 Console.WriteLine("outside");
  20.             }
  21.             else
  22.                 Console.WriteLine("border");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement