![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#6
|
||||
|
||||
|
Joer, estos problemas siempre me divirtieron, si te quieres quedar con tu profe preséntale esto:
Código:
function EsPrimo(Num: Integer): Boolean;
var
temp, i, integer;
enc: boolean;
begin
i := 3;
enc := N and 1 = 0;//es par
while (i < N - 1) and not Enc do begin
temp := N;
while Temp > 0 do Temp := N - i;
if N = 0 enc := true;
i := i + 2;
end;
return Enc;
end;
__________________
E pur si muove Última edición por marto fecha: 03-06-2003 a las 01:16:55. |
|
|
|