Tema: Help!
Ver Mensaje Individual
  #6  
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
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.
Responder Con Cita