Tema: Help!
Ver Mensaje Individual
  #5  
Antiguo 03-06-2003
Avatar de marto
marto marto is offline
Miembro
 
Registrado: may 2003
Ubicación: Barcelona, Catalunya
Posts: 882
Reputación: 22
marto Va por buen camino
Código:
function EsPrimo(Num: Integer): integer;
var
               temp, i, integer;
               enc: boolean;
begin
i := 2;
enc := false;
while (i < N - 1) and not Enc do begin
	temp := N;
	while Temp > 0 do Temp := N - i;
	if N = 0 enc := true;
	Inc(i);
end;
return Enc;
end;
No lo he probado, pero eso debería funcionar.
__________________
E pur si muove
Responder Con Cita