Advertisement
Guest User

Untitled

a guest
Feb 6th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace ConsoleApp1
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.            long x1 = long.Parse(Console.ReadLine());
  11.            long y1 = long.Parse(Console.ReadLine());
  12.            long x2 = long.Parse(Console.ReadLine());
  13.            long y2 = long.Parse(Console.ReadLine());
  14.             CloserPoint(x1, y1, x2, y2);
  15.            
  16.  
  17.         }
  18.         static void CloserPoint(long a, long b, long c,long d) {
  19.  
  20.             if (Math.Abs(a) + Math.Abs(b) < Math.Abs(c) + Math.Abs(d))
  21.             {
  22.                 Console.WriteLine((a,b));
  23.             }else if (Math.Abs(c) + Math.Abs(d) < Math.Abs(a) + Math.Abs(b))
  24.             {
  25.                 Console.WriteLine((c, d));
  26.             }else Console.WriteLine((a, b));
  27.  
  28.  
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement