Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- using namespace std;
- void nr_div_imp(int n, int &div)
- {
- div = 0;
- int d;
- if(n % 2 == 1)
- {
- div++;
- }
- for(d = 3; d * d < n; d += 2)
- {
- if(n % d == 0)
- {
- div++;
- }
- if(n % (n / d) == 0 && (n / d % 2 == 1))
- {
- div++;
- }
- }
- if(d % 2 == 1 && d * d == n)
- {
- div++;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement