Ver Mensaje Individual
  #22  
Antiguo 06-11-2007
Avatar de ZayDun
ZayDun ZayDun is offline
Miembro
 
Registrado: mar 2007
Posts: 129
Reputación: 20
ZayDun Va por buen camino
Talking

Hola de nuevo y perdonar por no haber podido contestar antes ya que no he tenido tiempo. buscando informacion sobre como hacerlo consegui un codigo que pide que indiques primero el numero a buscar y segundo un numero que debe de contener. mejor pongo el codigo para que lo veais vosotros mismos mas claro para una posible solucion. gracias a todos.



Código Delphi [-]
 var
a,b,q0,r0,q1,r1 : Integer;
begin
a:=0;
b:=0;
q0:=0;
r0:= 0;
q1:=0;
r1:=0;
MemoOut.Lines.Clear;
Form2.Edit1.Clear;
Form2.ShowModal;
if (Form2.ModalResult = mrOk) then
begin
a:= StrToInt(Form2.Edit1.Text); 
q0:= StrToInt(Form2.Edit1.Text);
Form2.Edit1.Clear;
Form2.ShowModal;
end;
if (Form2.ModalResult = mrOk) 
and (Form2.Edit1.Text <> '') then
begin
b:= StrToInt(Form2.Edit1.Text); 
r0:= StrToInt(Form2.Edit1.Text);
repeat
begin
q1:= Trunc(q0/r0);
r1:= q0-(q1*r0);
MemoOut.Lines.Add(IntToStr(q0)+' = '+IntToStr(r0)+'x'+IntToStr(q1)+'+'+IntToStr(r1));
q0:= r0; 
r0:= r1;
end;
until r0=0; 
end;
end;
Responder Con Cita