Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void factors(long long n)
- {
- long long z = 2;
- while ( (z * z) <= n )
- {
- if ( (n % z) == 0 )
- {
- cout << z << endl;
- n /= z;
- } else
- {
- z++;
- }
- }
- if (n > 1)
- {
- cout << n << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement