Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // CodeEval.com
  2. // Medium - Stack Implementation
  3. // Score: 56.362
  4.  
  5. using System;
  6. using System.IO;
  7. using System.Linq;
  8.  
  9. class Program
  10. {
  11. static int Main(string[] args)
  12. {
  13. using (StreamReader reader = File.OpenText(args[0]))
  14. {
  15. while (!reader.EndOfStream)
  16. {
  17. var line = reader.ReadLine().Split(null).Select(l => int.Parse(l)).Reverse();
  18.  
  19. int i = 1;
  20.  
  21. foreach (var l in line)
  22. {
  23. if (i % 2 == 1)
  24. Console.Write("{0} ", l);
  25.  
  26. i++;
  27. }
  28.  
  29. Console.WriteLine();
  30. }
  31. }
  32. return 0;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement