Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Longer_Line
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x1 = 0;
- double y1 = 0;
- double x2 = 0;
- double y2 = 0;
- double x3 = 0;
- double y3 = 0;
- double x4 = 0;
- double y4 = 0;
- x1 = double.Parse(Console.ReadLine());
- y1 = double.Parse(Console.ReadLine());
- x2 = double.Parse(Console.ReadLine());
- y2 = double.Parse(Console.ReadLine());
- x3 = double.Parse(Console.ReadLine());
- y3 = double.Parse(Console.ReadLine());
- x4 = double.Parse(Console.ReadLine());
- y4 = double.Parse(Console.ReadLine());
- if (Point1(x1, y1, x2, y2) > Point2(x3,y3,x4,y4))
- {
- if (x2 + y2 > x1 + y1)
- {
- Console.Write($"({x2}, {y2})({x1}, {y1})");
- }
- else
- {
- Console.Write($"({x1}, {y1})({x2}, {y2})");
- }
- }
- else
- {
- if (x4 + y4 > x3 + y3)
- {
- Console.Write($"({x4}, {y4})({x3}, {y3})");
- }
- else
- {
- Console.Write($"({x3}, {y3})({x4}, {y4})");
- }
- }
- }
- static double Point1(double x1, double y1, double x2, double y2)
- {
- double a1 = Math.Abs(x1 + y1);
- double a2 = Math.Abs(x2 + y2);
- if (a1>a2)
- {
- return a1;
- }
- else
- {
- return a2;
- }
- }
- static double Point2(double x3, double y3, double x4, double y4)
- {
- double a1 = Math.Abs(x3 + y3);
- double a2 = Math.Abs(x4 + y4);
- if (a1 > a2)
- {
- return a1;
- }
- else
- {
- return a2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement