S
sunshine1750
Unregistered / Unconfirmed
GUEST, unregistred user!
function Dg(A: integer):integer;
begin
{if A = 0 then
Result := 0;
if A = 1 then
Result := 1;}
if A >= 2 then
Result := Dg(A - 1) + Dg(A - 2);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := IntToStr(Dg(4));
end;
结果为什么会是3?好象那二句注释不起作用?
begin
{if A = 0 then
Result := 0;
if A = 1 then
Result := 1;}
if A >= 2 then
Result := Dg(A - 1) + Dg(A - 2);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := IntToStr(Dg(4));
end;
结果为什么会是3?好象那二句注释不起作用?