Well, what you have here is a basically a 3 variable integration with range from 0 to user entry for each variable where user entry is always positive. I would start out with something like this:
user enters 3
void someclass::getVariations(int x)
{
int a =0, b=0, c=0;
for(a =0; a <=x; a++)
{...