Код
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
const n=200;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
r,b:real;
x:array[1..n] of real;
begin
b:=2;
randomize;
for i:=1 to n do
begin
r:=random;
x[i]:=-ln(r)/b;
Form1.Memo1.Lines.Add(FloatToStr(x[i]));
end;
end;
end.
Сообщение отредактировано: Atreides -