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 TakeThePlaneDown
- {
- class TakeThePlaneDown
- {
- static void Main(string[] args)
- {
- int xHead = int.Parse(Console.ReadLine());
- int yHead = int.Parse(Console.ReadLine());
- int distance = int.Parse(Console.ReadLine());
- int planes = int.Parse(Console.ReadLine());
- // List<int> list = new List<int>();
- for (int i = 0; i < planes; i++)
- {
- int xPlane = int.Parse(Console.ReadLine());
- int yPlane = int.Parse(Console.ReadLine());
- int re1 = xHead + distance;
- int re2 = xHead - distance;
- int re3 = yHead + distance;
- int re4 = yHead - distance;
- if ((xPlane > re2 && xPlane < re1) && (yPlane > re4 && yPlane < re3))
- {
- // list.Add(xPlane);
- // list.Add(yPlane);
- Console.WriteLine("You destroyed a plane at [{0},{1}]" , xPlane, yPlane);
- }
- else
- {
- continue;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement