Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Center_Point
- {
- 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());
- FineCenterPoint(x1, y1, x2, y2);
- }
- static void FineCenterPoint(double x1, double y1, double x2, double y2)
- {
- double x = 0;
- double y = 0;
- double divX1 = Math.Abs(x - x1);
- double divY1 = Math.Abs(y - y1);
- double divX2 = Math.Abs(x - x2);
- double divY2 = Math.Abs(y - y2);
- double firstPoint = divX1 + divY1;
- double secondPoint = divX2 + divY2;
- if (firstPoint <= secondPoint)
- {
- Console.WriteLine($"({x1}, {y1})");
- }
- else
- {
- Console.WriteLine($"({x2}, {y2})");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment