Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. using System;
  6. using System.Linq;
  7. using System.IO;
  8. using System.Text;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11.  
  12. /**
  13. * CodinGame planet is being attacked by slimy insectoid aliens.
  14. * <---
  15. * Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player.
  16. **/
  17. class Player
  18. {
  19. static void Main(string[] args)
  20. {
  21. // game loop
  22. while (true)
  23. {
  24. int dist = 0;
  25. int minDist = 1000;
  26. int count=1;
  27. //string closestEnemy = "";
  28. //string enemy = "";
  29. for(int i=0;i<count;i++){
  30. string[] inputs = Console.ReadLine().Split(' ');
  31. string enemy = inputs[0];
  32. dist = int.Parse(Console.ReadLine());
  33. string closestEnemy = enemy;
  34. if(dist<minDist){
  35. Console.WriteLine(closestEnemy);
  36. Console.Error.WriteLine(dist);
  37. Console.Error.WriteLine(closestEnemy);
  38. count++;
  39. }
  40. }
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement