Advertisement
a53

Suma Divizorilor Pari

a53
Dec 12th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned long long n,s=0;
  7. cin>>n;
  8. unsigned long long d;
  9. for(d=1 ; d*d<n ; d++)
  10. if(n % d == 0)
  11. {
  12. if(d%2==0)
  13. s+=d;
  14. if(n/d%2==0)
  15. s+=n/d;
  16. }
  17. if(d * d == n)
  18. if(d%2==0)
  19. s+=d;
  20. cout<<s;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement