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;
- namespace Center_Point
- {
- class Center_Point
- {
- 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());
- double distanceFirstPoint = Distance(x1, y1);
- double disttanceSecondPoint = Distance(x2, y2);
- if (distanceFirstPoint < disttanceSecondPoint)
- Console.WriteLine($"({x1}, {y1})");
- else Console.WriteLine($"({x2}, {y2})");
- }
- public static double Distance(double x, double y)
- {
- double distance = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
- return distance;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement