Lucian_Adrian

#16 Suma divizorilor

Feb 12th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. int sum_div(int n)
  2. {
  3. int s = 0;
  4. for(int d=1 ; d <= n; d++)
  5. if(n%d==0)
  6. s += d;
  7. return s;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment