Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P08_CenterPoint
- {
- class Program
- {
- static void Main(string[] args)
- {
- double X1 = double.Parse(Console.ReadLine());
- double Y1 = double.Parse(Console.ReadLine());
- double X2 = double.Parse(Console.ReadLine());
- double Y2 = double.Parse(Console.ReadLine());
- PrintClosestToTheCenter(X1, Y1, X2, Y2);
- }
- static void PrintClosestToTheCenter(double x1, double y1, double x2, double y2)
- {
- if (x1*x1+(y1*y1)<=x2*x2+(y2*y2))
- {
- Console.WriteLine($"({x1}, {y1})");
- }
- else
- {
- Console.WriteLine($"({x2}, {y2})");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement