var
i:Integer;
begin
repeat
i:=i+1;
if i>7 then
Continue;
until i=20;
edit1.Text:=IntToStr(i);我想在这个程序中 最后的结果是 7
怎么运算结果 老是20 的呢。
在if i>7 then 即使成立了条件也不转到continue;这条语句上去 为什么???
i:Integer;
begin
repeat
i:=i+1;
if i>7 then
Continue;
until i=20;
edit1.Text:=IntToStr(i);我想在这个程序中 最后的结果是 7
怎么运算结果 老是20 的呢。
在if i>7 then 即使成立了条件也不转到continue;这条语句上去 为什么???
i:Integer;
begin
i := 0; //要初始化
repeat
i:=i+1;
if i>7 then
break; //用break跳出循环体, continue是继续循环.
until i=20;
edit1.Text := IntToStr(i);
那么要该成var
i:Integer;
begin
i := 0; //要初始化
repeat
i:=i+1;
if i >= 7 then //等于7时跳出
break; //用break跳出循环体, continue是继续循环.
until i=20; edit1.Text := IntToStr(i);
i:Integer;
begin
i := 0;
repeat
i:=i+1;
until i=7;
edit1.Text:=IntToStr(i);