Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- long x1 = long.Parse(Console.ReadLine());
- long y1 = long.Parse(Console.ReadLine());
- long x2 = long.Parse(Console.ReadLine());
- long y2 = long.Parse(Console.ReadLine());
- CloserPoint(x1, y1, x2, y2);
- }
- static void CloserPoint(long a, long b, long c,long d) {
- if (Math.Abs(a) + Math.Abs(b) < Math.Abs(c) + Math.Abs(d))
- {
- Console.WriteLine((a,b));
- }else if (Math.Abs(c) + Math.Abs(d) < Math.Abs(a) + Math.Abs(b))
- {
- Console.WriteLine((c, d));
- }else Console.WriteLine((a, b));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement