unit Unit9;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
TYPE
Arr=array[0..10] of integer;
type
TForm9 = class(TForm)
Button1: TButton;
function Arrinit(MM:arr):arr;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.dfm}
{ TForm9 }
function TForm9.Arrinit(MM: arr): arr;
var
i:integer;
begin
for I := 0 to 10 do
begin
MM[i]:=i;
end;
result:=MM;
end;
procedure TForm9.Button1Click(Sender: TObject);
var
AA:arr;
i,sum:Integer;
begin
sum:=0;
AA:=Arrinit(aa);
for i := 0 to 10 do
begin
sum:=sum+AA[i];
end;
showmessage(IntToStr(sum));
end;
end.