Guest User

Untitled

a guest
Sep 15th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.23 KB | None | 0 0
  1. bool etre_premier(ulong nb){
  2.     ulong i;
  3.  
  4.     if(nb%2 == 0)
  5.         return false;
  6.        
  7.     for(i = 1; i < sqrt(cast(real)(nb)); i+=2){
  8.         if(nb%i == 0)
  9.             return false;
  10.        
  11.     }
  12.    
  13.     return true;
  14. }
Add Comment
Please, Sign In to add comment