Advertisement
STANAANDREY

bac2k21 sb3 1

Mar 29th, 2022
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. void divPrim(int n, int &s) {
  2.     s = 0;
  3.     int f = 2;
  4.     while (n > 1) {
  5.         int  p = 0;
  6.         while (n % f == 0) {
  7.             n /= f;
  8.             p++;
  9.         }
  10.         if (p % 2) {
  11.             s += f;
  12.         }
  13.         f++;
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement