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.Globalization;
- namespace Test11
- {
- class Program
- {
- static void Main(string[] args)
- {
- System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- bool isRunning = true;
- int radius = 2;
- double radiusPow = Math.Pow(radius, 2);
- while (isRunning)
- {
- Console.WriteLine("Enter X:");
- int X = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter Y:");
- int Y = int.Parse(Console.ReadLine());
- double point = Math.Pow(X, 2) + Math.Pow(Y, 2);
- Console.WriteLine(point == radiusPow ? "The point is on the circle." : (point < radiusPow ? "The point is inside the circle." : "The point is outside the circle."));
- ConsoleKeyInfo toBeContinued = Console.ReadKey();
- Console.WriteLine();
- if (toBeContinued.KeyChar == 'N' || toBeContinued.KeyChar == 'n')
- {
- isRunning = false;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement