Advertisement
Doroteya

bachkawe

Oct 5th, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _8.Center_Point
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal x1 = decimal.Parse(Console.ReadLine());
  14.             decimal y1 = decimal.Parse(Console.ReadLine());
  15.             decimal x2 = decimal.Parse(Console.ReadLine());
  16.             decimal y2 = decimal.Parse(Console.ReadLine());
  17.  
  18.             ClosestPoint(x1, y1, x2, y2);
  19.         }
  20.         private static void ClosestPoint(decimal x1, decimal y1, decimal x2, decimal y2)
  21.         {
  22.             if ((Math.Abs(x1) <= Math.Abs(x2) && Math.Abs(y1) <= Math.Abs(y2)))
  23.                 Console.WriteLine($"({x1}, {y1})");
  24.             else
  25.                 Console.WriteLine($"({x2}, {y2})");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement