unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    StringGrid1: TStringGrid;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  I, J : Integer;
begin
  with StringGrid1 do
    for I := 0 to ColCount - 1 do
      for J:= 0 to RowCount - 1 do
          Cells[I,J] := FloattoStr(Random);

end;

procedure TForm1.Button2Click(Sender: TObject);
var
  I, J : Integer;
begin
  with StringGrid1 do
    for I := 0 to ColCount - 1 do
      for J:= 0 to RowCount - 1 do
          Cells[I,J] := FloatToStrF(Random, ffFixed, 5, 2);
end;

procedure TForm1.Button3Click(Sender: TObject);
var i,j: integer;
begin
   for i:=0 to 4 do
      for j:=0 to 4 do
         Stringgrid1.Cells[i,j]:= Format('%7d',[Random(151)])
end;

end.
