Вованичикчка
Var b:array [1..20] of integer; best,i:integer; begin randomize(); for i:=1 to 20 do b[i]:=random(31); for i:=1 to 20 do write(b[i],' '); writeln(); best:=b[1]; for i:=1 to 20 do begin if b[i]>best then best:=b[i]; end; writeln('Best: ',best); end.
Answers & Comments
best,i:integer;
begin
randomize();
for i:=1 to 20 do
b[i]:=random(31);
for i:=1 to 20 do
write(b[i],' ');
writeln();
best:=b[1];
for i:=1 to 20 do
begin
if b[i]>best then
best:=b[i];
end;
writeln('Best: ',best);
end.