Guest User

Untitled

a guest
Oct 16th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. int nbDiviseurs3 (int a)
  2. {
  3.     int result = 2;
  4.     int borne = 2;
  5.     int i = 2;
  6.  
  7.     if (a%2 != 0)
  8.         borne = 3;
  9.  
  10.     if (sqrt(a) == floor(sqrt(a)))
  11.         result++;
  12.  
  13.     for (int i = 2; i*i < a; i++)
  14.     {
  15.         if (a%i == 0)
  16.             result = result + 2;
  17.     }
  18.     return result;
  19. }
Add Comment
Please, Sign In to add comment