This code will build you a translate table to match the letters and numbers. You can then use the number (converted by: int i = number - '0' - 1) to get the correct letter for future input strings.
std::string letters = "bludsnake";
std::string numbers = "956324718";
std::string table = "";
table.append(letters.length(), ' ');
for (int i = 0; i < letters.length(); ++i)
{
char c = letters[i];
int index = numbers[i] - '0';
table[index - 1] = c;
}