[img:781af2fca6]
http://tiprogs.free.fr/premier.gif[/img:781af2fca6]
(dsl Rangi, je l'ai fais sur 89, c tt ce ke j'avais ss la main)
& le code :
[quote:781af2fca6]Premier()
Prgm
Local x,y
ClrIO
Input "Nbr:",x
For y,2,x,1
If x/y=iPart(x/y) Then
Goto fin
EndIf
If y>x/3 Then // pas la peine de tester jusqu'au bout, au 1/3 du nbr, sa suffit
x»y
Goto fin
EndIf
flib("slmsg:"&string(iPart(y/x*300))&"% "&string(y))
EndFor
Lbl fin
If y=x Then
Disp "Nombre premier"
Else
Disp "Divisible par "&string(y)
EndIf
Pause
DispHome
EndPrgm[/quote:781af2fca6]
pr les gds nombres, il est assez lent. pr faire le test avec 251, il a fallu 6 sec, 5 min avec 10007, ms y devrait y avr moyen de reduire