Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Точка_във_фигурата
- {
- class Program
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- var x1 = 0;
- var y1 = 0;
- var x2 = 3 * h;
- var y2 = h;
- bool insidefigure1 = x > x1 && x < x2 && y > y1 && y < y2;
- bool outsidefigure1 = x < x1 || x > x2 || y < y1 || y > y2;
- var x3 = h;
- var y3 = h;
- var x4 = 2 * h;
- var y4 = 4 * h;
- bool insidefigure2 = x > x3 && x < x4 && y > y3 && y < y4;
- bool outsidefigure2 = x < x3 || x > x4 || y < y3 || y > y4;
- bool insideborder = x > x3 && x < x4 && y == y3;
- if (insidefigure1 || insidefigure2 || insideborder)
- {
- Console.WriteLine("inside");
- }
- else if (outsidefigure1 && outsidefigure2)
- {
- Console.WriteLine("outside");
- }
- else
- {
- Console.WriteLine("border");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement