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;
- using System.Globalization;
- namespace _10PointInsideCircleOutsideRectangle
- {
- class PointInsideCircleOutsideRectangle
- {
- static void Main()
- {
- System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- Console.Write("Enter a value for x: ");
- double x = double.Parse(Console.ReadLine());
- Console.Write("Enter a value for y: ");
- double y = double.Parse(Console.ReadLine());
- double radius = Math.Sqrt((x - 1) * (x - 1) + (y - 1) * (y - 1));
- if (radius <= 1.5 && y > 1)
- {
- Console.WriteLine("Point insid a circle and outside a rectangle: Yes");
- }
- else
- {
- Console.WriteLine("Point insid a circle and outside a rectangle: No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement