delphi for 循环 to和downto的理解

2018-10-30

delphi for 循环 to和downto的理解

procedure TForm1.btn1Click(Sender: TObject);
var
  c:Integer;
begin
  for c:=5 downto 0 do
  begin
    ShowMessage(IntToStr(c));
  end;
end;

  for c:=0 to 5 do
  begin
    ShowMessage(IntToStr(c));
  end;
end;
end.

其实就是证明循环式从小到大还是从大到小

阅读69