Advertisement
a53

Suma divizorilor primi

a53
Jan 2nd, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int sum_div_prim ( int x , int & y )
  2. {
  3. int i;
  4. y = 0 ;
  5. for ( i = 1 ; i * i < x ; ++i )
  6. if ( x % i == 0 ) y = y + i , y = y + x / i ;
  7. if ( i * i == x ) y = y + i ;
  8. return y ;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement