<html> <head> <title>Les nombres premiers</title> </head> <body> <script> // On cherche les nombres premiers jusqu'à max var max = 1000; for(i = 2; i <= max; i++) { var j = 1; var racine = Math.floor(Math.sqrt(i)); do { j++; } while(j <= racine && i%j != 0); if(j > racine) { // On affiche les nombres premiers trouvés document.write(i +"<br>") } } </script> </body> </html>
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 903 553 membres 131 nouveaux aujourd'hui 16 195 membres club