using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
private const string CodeChars = "123456789ABCDEFGHIJKLMNPQRSTWXYZ";
private static readonly Dictionary<char, int> CharToValue = new Dictionary<char, int>();
public static void Main()
for (var i = 0; i<CodeChars.Length; i++)
CharToValue[CodeChars[i]] = i;
var codeValuePart = code.Substring(0, code.Length - 1);
Console.WriteLine(codeValuePart);
for (var i = codeValuePart.Length - 1; i >= 0; i--)
Console.WriteLine(CharToValue[codeValuePart[i]] + " * " + Math.Pow(CodeChars.Length, codeValuePart.Length-(i+1)));
val += CharToValue[codeValuePart[i]] * (int)(Math.Pow(CodeChars.Length, codeValuePart.Length-(i+1)));
Console.WriteLine(code + " = " + val);