fork download
  1. // by rakib_cse06
  2. // http://stackoverflow.com/questions/17006745/
  3. // /prime-factorization-using-seive-method/17006834
  4. // ?noredirect=1#comment24600753_17006834
  5.  
  6. void primeFactorize( long n ){
  7. listSize = 0;
  8. long sqrtN = (long)sqrt((double)n);
  9. for( long i = 2; i <= sqrtN; i++ ) {
  10.  
  11. while( n % i /*pvalues[i]*/ == 0 ) {
  12. n /= i /*pvalues[i]*/;
  13. List[listSize] = i /*pvalues[i]*/;
  14. listSize++;
  15. }
  16. }
  17. if( n > 1 ) {
  18. List[listSize] = n; listSize++;
  19. }
  20. }
  21.  
  22.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout

Standard output is empty