STANAANDREY

bacT16 SIII 1

May 18th, 2021 (edited)
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int nrDivPrimi(int n) {
  5.     int f = 2, nr = 0;
  6.     while (n > 1) {
  7.         int p = 0;
  8.         while (n % f == 0) {
  9.             n /= f;
  10.             p++;
  11.         }
  12.         if (p % 2) {
  13.             nr++;
  14.         }
  15.         p = 0;
  16.         f++;
  17.     }
  18.     return nr;
  19. }
  20.  
  21. int main() {
  22.     //test code here
  23.     return 0;
  24. }
  25.  
Add Comment
Please, Sign In to add comment