Program n1; Uses CRT; Const n=10; Var a: array[1..n] of integer; i,sum,pr,max,min: integer; begin ClrScr; Randomize; for i:=1 to n do begin a[i]:=random(50); write(a[i]:3); sum:=sum+a[i]; If a[i]>max then max:=a[i]; end; min:=max; For i:=1 to n do If min>a[i] then min:=a[i]; pr:=max*min; writeln; Writeln('Summa vseh elementov=',sum,' Proizvedenie max i min =',pr); readln end.
Program n1;
Uses CRT;
Const n=10;
Var a: array[1..n] of integer;
i,sum,pr,max,min: integer;
begin
ClrScr;
Randomize;
for i:=1 to n do
begin
a[i]:=random(50);
write(a[i]:3);
sum:=sum+a[i];
If a[i]>max then max:=a[i];
end;
min:=max;
For i:=1 to n do
If min>a[i] then min:=a[i];
pr:=max*min;
writeln;
Writeln('Summa vseh elementov=',sum,' Proizvedenie max i min =',pr);
readln
end.