Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp170
- {
- 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());
- CheckClosestToNull(x1, y1, x2, y2);
- }
- private static void CheckClosestToNull(double x1, double y1, double x2, double y2)
- {
- if (Math.Abs(x1) > Math.Abs(x2))
- {
- Console.Write("("+x2+", ");
- }
- else if (Math.Abs(x2) > Math.Abs(x1))
- {
- Console.Write("("+x1+", ");
- }
- else
- {
- Console.Write("("+x1+", ");
- }
- if (Math.Abs(y1) > Math.Abs(y2))
- {
- Console.Write(y2+")");
- }
- else if (Math.Abs(y2) > Math.Abs(y1))
- {
- Console.Write(y1+")");
- }
- else
- {
- Console.Write(y1+")");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement