Advertisement
Ionu28

divizorii proprii

Jul 12th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. { int n, i, nr_div=0;
  6. cin >> n;
  7. if(n % 2 == 0)
  8. { nr_div=1;
  9. for(i = 2; i <= sqrt(n); i+=2)
  10. {
  11. if(n % i == 0)
  12. {
  13. nr_div++;
  14. }
  15. }
  16. }
  17. cout << nr_div;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement