Нужно создать блок-схемы по кодам программы. Delphi
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, Buttons, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Button1: TButton;
Label2: TLabel;
Edit3: TEdit;
Edit4: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit5: TEdit;
Button2: TButton;
Button3: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a:array of real; i:integer; temp,min,summ:real; j,mini,first,second:integer;
begin
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
setlength(a,strtoint(edit1.text));
first:=-1;
second:=-1;
min:=40;
mini:=0;
for i:=0 to strtoint(edit1.text)-1 do
begin
a:=Random(40)-20+random;
if (a<0) and (first=-1) then
first:=i
else
if (a<0) and (second=-1) then
second:=i;
if a<min then
begin
min:=a;
mini:=i;
end;
Edit2.Text:=Edit2.text+' '+floattostrf(a,ffFixed,5,3);
end;
summ:=0;
for i:=first+1 to second-1 do
summ:=summ+a;
edit3.Text:=floattostrf(summ,ffFixe d,5,3);
for i:=0 to strtoint(edit1.text)-1 do
for j:=i to strtoint(edit1.text)-1 do
if a>a[j] then
begin
temp:=a;
a:=a[j];
a[j]:=temp;
end;
for i:=0 to strtoint(edit1.text)-1 do
Edit4.Text:=Edit4.Text+' '+floattostrf(a,ffFixed,5,3);
Edit5.Text:=inttostr(mini+1);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
halt;
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, Buttons, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Button1: TButton;
Label2: TLabel;
Edit3: TEdit;
Edit4: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit5: TEdit;
Button2: TButton;
Button3: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a:array of real; i:integer; temp,min,summ:real; j,mini,first,second:integer;
begin
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
setlength(a,strtoint(edit1.text));
first:=-1;
second:=-1;
min:=40;
mini:=0;
for i:=0 to strtoint(edit1.text)-1 do
begin
a:=Random(40)-20+random;
if (a<0) and (first=-1) then
first:=i
else
if (a<0) and (second=-1) then
second:=i;
if a<min then
begin
min:=a;
mini:=i;
end;
Edit2.Text:=Edit2.text+' '+floattostrf(a,ffFixed,5,3);
end;
summ:=0;
for i:=first+1 to second-1 do
summ:=summ+a;
edit3.Text:=floattostrf(summ,ffFixe d,5,3);
for i:=0 to strtoint(edit1.text)-1 do
for j:=i to strtoint(edit1.text)-1 do
if a>a[j] then
begin
temp:=a;
a:=a[j];
a[j]:=temp;
end;
for i:=0 to strtoint(edit1.text)-1 do
Edit4.Text:=Edit4.Text+' '+floattostrf(a,ffFixed,5,3);
Edit5.Text:=inttostr(mini+1);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
halt;
end;
end.