09. Longer Line
Здравейте,
в джъджа ми дава грешка на последния тест и не мога да я открия в кода си. Ако някой може да помогне. Ето го и кода ми :
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LongerLine
{
class Program
{
static void Main(string[] args)
{
double x1 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double x2 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double y1 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double y2 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double z1 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double z2 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double m1 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
double m2 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
if ((Math.Abs(x1 - y1)) >= (Math.Abs(z1 - m1)) && (Math.Abs(x2 - y2)) >=(Math.Abs(z2 - m2)))
{
coordinats(x1, x2, y1, y2);
}
else
{
coordinats(z1, z2, m1, m2);
}
}
static void coordinats(double x1, double x2, double y1, double y2)
{
if ((Math.Abs(x1) - Math.Abs(y1)) <= (Math.Abs(y1) - Math.Abs(x1)) && (Math.Abs(x2) - Math.Abs(y2)) <= (Math.Abs(y2) - Math.Abs(x2)))
{
Console.Write("({0}, {1})", x1, x2);
Console.WriteLine("({0}, {1})", y1, y2);
}
else
{
Console.Write("({0}, {1})", y1, y2);
Console.WriteLine("({0}, {1})", x1, x2);
}
}
}
}