Ver Mensaje Individual
  #6  
Antiguo 10-06-2007
N4ota N4ota is offline
Registrado
 
Registrado: may 2007
Posts: 4
Reputación: 0
N4ota Va por buen camino
Red face

agradezco a todos por la pequeña ayudita k me dieron en programacion en especial a roman y seoane por hacerme notar mis faltas el problemita me costo algo pero llegue a una conclusion por mi cuenta y funca aunque me costo lo dejare por aqui para futuras generaciones
Código Delphi [-]
 
function Verif_primo(n:integer):boolean;
var
    c,residuo:integer;
    b:boolean;
begin
  if n>1 then
  begin
    c:=1;
    repeat
    c:=c+1;
    residuo:=n mod c;
    until residuo=0;
    if n=c then
    begin
    b:=true;
  end
    else
    begin
    b:=false;
    end;
  end
  else
  begin
  b:=true;
  end;
  result:=b
end;
function S_primo(n:integer):integer;
var
    c,c1,c2:integer;
begin
  c:=0;
  c1:=0;
  c2:=0;
    repeat
    c:=c+1;
      if verif_primo(c)=true then
      begin
      c1:=c+c1;
      c2:=c2+1;
      end;
    until (c2=n);
    result:=c1;
end;
jejeje me gusta derrochar en codigo

Última edición por marcoszorrilla fecha: 10-06-2007 a las 23:39:51. Razón: Añadir etiquetas Delphi
Responder Con Cita