Created
June 2, 2014 20:11
-
-
Save briandiaz/5933973870e44024a4d4 to your computer and use it in GitHub Desktop.
Find a Writer problem at CodeEval.com (https://www.codeeval.com/open_challenges/97/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Brian Díaz | |
*/ | |
using System; | |
using System.Text; | |
using System.IO; | |
using System.Collections.Generic; | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
string Line = ""; | |
string[] Encoded; | |
string NameEncoded; | |
string[] Keys; | |
String WriterName; | |
System.IO.StreamReader file = new System.IO.StreamReader(args[0]); | |
while ((Line = file.ReadLine()) != null) | |
{ | |
Encoded = Line.Split('|'); | |
NameEncoded = Encoded[0]; | |
Keys = Encoded[1].Split(' '); | |
WriterName = String.Empty; | |
foreach (string Position in Keys) | |
if (!Position.Equals("")) | |
WriterName += NameEncoded[Convert.ToInt32(Position) - 1]; | |
Console.WriteLine(WriterName); | |
WriterName = String.Empty; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment