Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _16.Number0100ToText
- {
- class Number0100ToText
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- int firstFigureX1 = 0;
- int firstFigureX2 = h * 3;
- int firstFigureY1 = 0;
- int firstFigureY2 = h;
- bool pointIsInFirstFigure = x > firstFigureX1 && x < firstFigureX2 &&
- y > firstFigureY1 && y < firstFigureY2;
- bool pointIsOnFirstFigureBorder = ((x == firstFigureX1 || x == firstFigureX2) && (y >= firstFigureY1 && y <= firstFigureY2)) ||
- ((y == firstFigureY1 || y == firstFigureY2) && (x >= firstFigureX1 && x <= firstFigureX2));
- int secondFigureX1 = h;
- int secondFigureX2 = h * 2;
- int secondFigureY1 = h;
- int secondFigureY2 = h * 4;
- bool pointIsInSecondFigure = x > secondFigureX1 && x < secondFigureX2 &&
- y >= secondFigureY1 && y < secondFigureY2;
- bool pointIsOnSecondFigureBorder = ((x == secondFigureX1 || x == secondFigureX2) && (y >= secondFigureY1 && y <= secondFigureY2)) ||
- ((y == secondFigureY1 || y == secondFigureY2) && (x >= secondFigureX1 && x <= secondFigureX2));
- bool isInsideWholeFigure = pointIsInFirstFigure || pointIsInSecondFigure;
- bool isOnBorderOfTheWholeFigure = pointIsOnFirstFigureBorder || pointIsOnSecondFigureBorder;
- if (isInsideWholeFigure)
- {
- //vutre
- Console.WriteLine("inside");
- }
- else if (isOnBorderOfTheWholeFigure)
- {
- //border
- Console.WriteLine("border");
- }
- else
- {
- //vun
- Console.WriteLine("outside");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment