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 Problem_2___Take_the_plane_down
- {
- class Program
- {
- static void Main(string[] args)
- {
- long headquarterX = long.Parse(Console.ReadLine());
- long headquarterY = long.Parse(Console.ReadLine());
- long distance = long.Parse(Console.ReadLine());
- long planesNumbers = long.Parse(Console.ReadLine());
- for (long i = 0; i < planesNumbers; i++)
- {
- long planeX = long.Parse(Console.ReadLine());
- long planeY = long.Parse(Console.ReadLine());
- long distanceX = headquarterX - planeX;
- long distanceY = headquarterY - planeY;
- double c = Math.Sqrt((distanceX * distanceX) + (distanceY * distanceY));
- if (c <= distance)
- {
- Console.WriteLine("You destroyed a plane at [{0},{1}]", planeX, planeY);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement