Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MyPlane
- {
- static void Main(string[] args)
- {
- int firstRow = int.Parse(Console.ReadLine());
- int secondRow = int.Parse(Console.ReadLine());
- int countryRadius = int.Parse(Console.ReadLine());
- int detectedPlanes = int.Parse(Console.ReadLine());
- for (int plane = 0; plane < detectedPlanes; plane++)
- {
- int planeX = int.Parse(Console.ReadLine());
- int planeY = int.Parse(Console.ReadLine());
- int planeDistanceX = planeX - firstRow;
- int planeDistanceY = planeY - secondRow;
- double distanceToPlane = Math.Sqrt((planeDistanceX * planeDistanceX) + (planeDistanceY * planeDistanceY));
- if (countryRadius >= distanceToPlane)
- {
- Console.WriteLine("You destroyed a plane at [{0},{1}]", planeX, planeY);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement