Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.IO;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- /**
- * CodinGame planet is being attacked by slimy insectoid aliens.
- * <---
- * Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player.
- **/
- class Player
- {
- static void Main(string[] args)
- {
- // game loop
- while (true)
- {
- int dist = 0;
- int minDist = 1000;
- int count=1;
- //string closestEnemy = "";
- //string enemy = "";
- for(int i=0;i<count;i++){
- string[] inputs = Console.ReadLine().Split(' ');
- string enemy = inputs[0];
- dist = int.Parse(Console.ReadLine());
- string closestEnemy = enemy;
- if(dist<minDist){
- Console.WriteLine(closestEnemy);
- Console.Error.WriteLine(dist);
- Console.Error.WriteLine(closestEnemy);
- count++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement