reapeat until计算1累加到100的和

//reapeat until计算1累加到100的和
procedure TForm1.Button1Click(Sender: TObject); 
var
    i,sum:integer;
begin
     i := 1;
     sum := 0;
      repeat
         sum :=sum +i;
         i :=i + 1;
      until i > 100;
     showmessage( '1ÀÛ¼Óµ½100µÄºÍΪ' +inttostr(sum));
end;




你可能感兴趣的:(计算)