Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CodeEval.com
- // Medium - Stack Implementation
- // Score: 56.362
- using System;
- using System.IO;
- using System.Linq;
- class Program
- {
- static int Main(string[] args)
- {
- using (StreamReader reader = File.OpenText(args[0]))
- {
- while (!reader.EndOfStream)
- {
- var line = reader.ReadLine().Split(null).Select(l => int.Parse(l)).Reverse();
- int i = 1;
- foreach (var l in line)
- {
- if (i % 2 == 1)
- Console.Write("{0} ", l);
- i++;
- }
- Console.WriteLine();
- }
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement