in the string library there is a function to parse a string into tokens... but I'm not sure what that is called off hand.. just man the string libraby to find it.
Or you could try something like this
int somefunction()
int foo;
cin >> foo;
int hold;
vector<int> vec;
int m;
while(foo%10 > 9)
{
m++;
} //now you know how many digits you have
int digit=10;
pow(digit,m)
for(int i=0;i<m;i++)
{
vec.push_back(foo%digit);
digit = digit / 10;
}
int total = 1;
for(int i=0;i<m;i++)
{
total *= vec;
}
return total;
}
that might work.. but it's not be tested or anything.... gl