1 сем 1 курс Бельтюков БТС / ЛБ 5 / 11
.DOCXМинистерство науки и высшего образования Российской Федерации
Федеральное государственное автономное образовательное учреждение высшего образования «Санкт-Петербургский государственный электротехнический университет “ЛЭТИ” им. В.И. Ульянова (Ленина)» (СПбГЭТУ)
Факультет информационно-измерительных и биотехнических систем Кафедра Биотехнических систем
Лабораторная работа №5
по дисциплине « Информатика»
Тема: Графические примитивы
Студент гр.
Преподаватель
0501
доц.
к.т.н.
18.10.2020
Конунников Бельтюков М.В.
г.Санкт-Петербург
2020 г.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Grids, Vcl.StdCtrls,
Vcl.Buttons;
type
TForm1 = class(TForm)
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
Shape9: TShape;
Shape10: TShape;
Shape11: TShape;
Shape12: TShape;
Shape13: TShape;
Shape14: TShape;
Shape15: TShape;
Shape16: TShape;
Shape17: TShape;
Shape18: TShape;
Shape19: TShape;
Shape20: TShape;
Shape21: TShape;
Shape22: TShape;
Shape23: TShape;
Shape24: TShape;
Shape25: TShape;
SGIshood: TStringGrid;
SGItog: TStringGrid;
LSort: TLabel;
ESort: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Clouse: TBitBtn;
Button1: TButton;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Msh, MIs, MIf : array[1..5,1..5] of integer;
Mass : array [1..25] of integer;
I, J, K,temp : byte;
begin
Randomize;
for I:= 1 to 5 do
begin
SGIshood.Cells[0,I]:= IntToStr(I);
SGIshood.Cells[I,0]:= IntToStr(I);
SGItog.Cells[0,I]:= IntToStr(I);
SGItog.Cells[I,0]:= IntToStr(I);
end;
for I:=1 to 5 do
for J := 1 to 5 do
begin
MSh[I,J] := 0;
MIf[I,J] := 0;
end;
For I := 1 to 5 do
For J := 1 to 6-I do
MSh[I,J] := 1;
For I := 1 to 5 do
For J := 1 to 5 do
begin
MIs[I,J] := Random(9)+1;
SGIshood.Cells[I,J] := IntToStr(MIs[I,J]);
end;
For I := 1 to 5 do
For J := 1 to 5 do
begin
If MSh[I,J] = 1 then MIf[I,J] := MIs[I,J];
SGItog.Cells[I,J] := IntToStr(MIf[I,J]);
end;
k := 0;
For I := 1 to 5 do
For J := 1 to 5 do
begin
Inc(k);
Mass[k] := MIs[J,I];
end;
LSort.Caption := '';
For I:=1 to 25 do LSort.Caption := LSort.Caption+IntToStr(Mass[I])+ '';
for I := 1 to 25 do
begin
j:=i;
temp:=Mass[i];
while ((j>1)and (Mass[j-1]>temp)) do
begin
Mass[j] := Mass[j-1];
dec(j);
end;
Mass[j]:=temp;
end;
k:=0;
ESort.Text:='';
for I := 1 to 25 do
ESort.Text := ESort.Text+IntToStr(Mass[I])+ '';
end;
end.