Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MoreMethodExercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- int x1 = int.Parse(Console.ReadLine());
- int y1 = int.Parse(Console.ReadLine());
- int x2 = int.Parse(Console.ReadLine());
- int y2 = int.Parse(Console.ReadLine());
- double firstDistance = Math.Sqrt(Math.Pow(x1, 2) + Math.Pow(y1, 2));
- double secondDistance = Math.Sqrt(Math.Pow(x2, 2) + Math.Pow(y2, 2));
- if(firstDistance < secondDistance)
- {
- Console.WriteLine("({0},{1})",x1,y1);
- }
- else if(secondDistance < firstDistance)
- {
- Console.WriteLine("({0},{1})",x2,y2);
- }
- else
- {
- Console.WriteLine("({0},{1})", x1, y1);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment