using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("olzeasbtgq"); WillReturn.Add("h3110"); //hello } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); string A = InputList[0]; string S = InputList[1]; var sb = new System.Text.StringBuilder(); foreach (char EachChar in S) { if ('0' <= EachChar && EachChar <= '9') { sb.Append(A[EachChar - '0']); } else { sb.Append(EachChar); } } Console.WriteLine(sb.ToString()); } }