Just read whatever the user inputs as a string and convert by hand. You're going to have to do it for the spelled out version anyway. Try something like:
1 2 3 4
std::string s;
std::cin >> s;
int n;
if(s == "0" || s == "zero") n = 0;
You will also have to recognize whether or not the input string contains only alphabetic characters or numeric characters to determine which conversion you want to use.
Use the std::find_if or std::count_if algorithm to determine which:
cout << "Please enter your number: " << flush;
string s;
getline( cin, s );
if (count_if( s.begin(), s.end(), ptr_fun <int, int> ( isdigit ) ) == 0)
{
// perform your 'name' to 'digits' conversion here
}
else
{
// perform your 'digits' to 'name' conversion here
}