Advertisement
TeMePyT

Untitled

May 29th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P08_CenterPoint
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double X1 = double.Parse(Console.ReadLine());
  10. double Y1 = double.Parse(Console.ReadLine());
  11. double X2 = double.Parse(Console.ReadLine());
  12. double Y2 = double.Parse(Console.ReadLine());
  13.  
  14. PrintClosestToTheCenter(X1, Y1, X2, Y2);
  15. }
  16.  
  17. static void PrintClosestToTheCenter(double x1, double y1, double x2, double y2)
  18. {
  19. if (x1*x1+(y1*y1)<=x2*x2+(y2*y2))
  20. {
  21. Console.WriteLine($"({x1}, {y1})");
  22. }
  23.  
  24. else
  25. {
  26. Console.WriteLine($"({x2}, {y2})");
  27. }
  28.  
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement