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.

 

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

posted on 2020-11-12 18:13  癫狂编程  阅读(523)  评论(0编辑  收藏  举报

导航

好的代码像粥一样,都是用时间熬出来的