512 граммов
1*2=2
2*2=4
4*2=8
8*2=16
16*2=32
32*2=64
64*2=128
128*2=256
256*2=512
Var
a:array[1..6]of integer;
i,j,max:integer;
function mx(a,b:integer):integer;
begin
if a>b then result:=a else result:=b;
end;
begin
for i:=1 to 6 do
begin
a[i]:=random(20);
write(a[i]:4);
end;
writeln;
max:=a[1];
for i:=1 to 6 do
for j:=i+1 to 6 do
if mx(a[i],a[j])>max then max:=mx(a[i],a[j]);
writeln('max=',max);
<span>end.</span>
Program chik;
var a:array[1..1000]of integer;
i,n:integer;
begin
readln(n);
randomize;
for i:=1 to n do
begin
a[i]:=random(41)-20;
if(a[i]<0)then a[i]:=5;
end;
for i:=1 to n do
write(a[i],' ');
end.