Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08_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());
- double perpendicular1 = Check(x1, y1);
- double perpendicular2 = Check(x2, y2);
- if (perpendicular1 <= perpendicular2)
- {
- Console.WriteLine($"({x1}, {y1})");
- }
- else
- {
- Console.WriteLine($"({x2}, {y2})");
- }
- }
- static double Check(double x, double y)
- {
- double cPow2 = Math.Pow(x, 2) + Math.Pow(y, 2);
- return cPow2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement