1234567891011121314
void Factorize(unsigned u) { for(unsigned i(2);i<u;i++) { if(u%i == 0) { cout << i; if (u!=i) { cout << "*"; Factorize(u/i); } } } }
123456789101112131415
void Factorize(unsigned u) { for(unsigned i(2);i<=u;i++) //(1) { if(u%i == 0) { cout << i; if (u!=i) { cout << "*"; Factorize(u/i); return; //(2) } } } }