Advertisement
GeeckoDev

Untitled

Aug 30th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. int nbDiviseurs(int n)
  2. {
  3.   int n_div = 2, sqrt_n = sqrtf(n);
  4.    
  5.   for (i=2; i<=sqrt_n; i++)
  6.   {
  7.     if (n % i == 0) n_div += 1 + i!=n/i;
  8.   }
  9.  
  10.   return n_div;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement