continue break

//建立1个ConsoleApplication 把代码往里面粘贴
/////////////////////////////////////////////////////
{break}
program Project1;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var i:Integer;
begin
{break在各循环中调用Break,可以使得程序的执行流程立即跳到循环的结尾。}
  for I:=1 to 10 do
  begin
    if I=5 then Break;
    Writeln(i);
  end;
  Readln;
end.
/////////////////////////////////////////////////////
{Continue}
program Project1;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var i:Integer;
begin 
 {continue}
  for I:=0 to 10 do
  begin
    if i=3 then Continue;//=这个数就跳过
    Writeln(IntToStr(I));
  end;
  Readln;
end.
//////////////////////////////////////////////////////////////////////////
 




posted @ 2012-05-26 08:14  XE2011  阅读(138)  评论(0编辑  收藏  举报