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;
- class PointInsideCircleOutsideRectangle
- {
- static void Main()
- {
- double x = double.Parse(Console.ReadLine());
- double y = double.Parse(Console.ReadLine());
- double radius = 1.5;
- if ((x - 1) * (x - 1) + (y - 1) * (y - 1) <= Math.Pow(radius, 2))
- {
- if (y > 1 && (x > -0.5 && x < 2.5))
- {
- Console.WriteLine("The point is IN the circle and OUT of the rectangle. - YES -");
- }
- else
- {
- Console.WriteLine("The point is IN the circle, but also IN the rectangle. - NO -");
- }
- }
- else
- {
- Console.WriteLine("The point is OUT of circle and OUT of rectangle. - NO -");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement