如何产生随机数 123 ,456 ,三个整数的

解决方案 »

  1.   

    showmessage(inttostr(1+random(9))+inttostr(random(9))+inttostr(random(9)));
      

  2.   

    procedure TForm1.Button2Click(Sender: TObject);
    var i,u: integer;
    begin
    u:=1;
    While u=1  do
     begin
      i:=random(1000);
      if i>100 then
      begin
       ShowMessage(IntToStr(i));
       u:=0;
      end
     else
      i:=random(1000);
    end;
    end;
      

  3.   

    我同意楼上的做法,不过我觉得可以写的简单点!
    var i,u: integer;
    begin
    u:=1;
    While(1)
     begin
      i:=random(1000);
      if 100 >= i then
         continue;  
      begin
       ShowMessage(IntToStr(i));
       break
      end;
     end;
    end;
      

  4.   

    cll007(gazo) 的做法就可以啦