Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void divPrim(int n, int &s) {
- s = 0;
- int f = 2;
- while (n > 1) {
- int p = 0;
- while (n % f == 0) {
- n /= f;
- p++;
- }
- if (p % 2) {
- s += f;
- }
- f++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement