unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Spin, Grids; type TForm1 = class(TForm) ListBox1: TListBox; Button1: TButton; SpinEdit1: TSpinEdit; SpinEdit2: TSpinEdit; SpinEdit3: TSpinEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; CheckBox1: TCheckBox; StringGrid1: TStringGrid; Label4: TLabel; StringGrid2: TStringGrid; StringGrid3: TStringGrid; Label5: TLabel; Label6: TLabel; Edit1: TEdit; Label7: TLabel; Edit2: TEdit; Label8: TLabel; Edit3: TEdit; Label9: TLabel; procedure Button1Click(Sender: TObject); procedure Solution(min, max, numOfWeeks: integer); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; var priceA:array[1..700] of integer; devA:array[1..700] of integer; probOfDemand:array[4..16] of integer; probOfWeek:array[0..7] of integer; probOfSun:array[0..7] of integer; S:integer; C1, C2, C3:integer; implementation {$R *.dfm} procedure TForm1.Solution(min, max, numOfWeeks: integer); var i, j, numS, gid: integer; p: integer; demand: integer; price:integer; other:integer; summa:longint; minn: real; // midI, devI:integer; begin randomize; minn:=100000000; for numS:=min to max do begin ListBox1.Items.Add(' Кол-во гидов: '+IntToStr(numS)); summa:=0; for i:=1 to numOfWeeks*7 do begin p:=random(100); // Вычисляется спрос for j:=4 to 16 do if (p0) then {если будний день} begin p:=random(100); for j:=0 to 7 do {вычисл. предлож-я в будние} if (p