#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { long unsigned int nUserInput; cin >> nUserInput; for(long unsigned int nIterator = 2; nIterator <= nUserInput; nIterator++) { if((nUserInput % nIterator) == 0) { cout << nIterator; nUserInput /= nIterator; nIterator = 1; if(nIterator != nUserInput) { cout << " * "; } } } system("PAUSE"); return EXIT_SUCCESS; }
0 Response for the "Prime Factor CPP/C++"
Post a Comment