Respuesta :

It's can be done with For-Loop.
for(a=0;a<x;a++){
for(b=0;b<x;b++){
for(c=0;c<x;c++){
//This will include every combination and solve the problem.

}
}
}