Var a:array [1..10] of integer; i,n,max:integer; Begin randomize; for i:=1 to 10 do a[i]:=random(50); for i:=1 to 10 do write(a[i],' '); max:=a[1]; for i:=1 to 10 do if a[i]>max then Begin max:=a[i]; n:=i; end; max:=0; for i:=1 to n-1 do max:=max+a[i]; writeln; writeln(max); End. Не забудьте сказать
a:array [1..10] of integer;
i,n,max:integer;
Begin
randomize;
for i:=1 to 10 do
a[i]:=random(50);
for i:=1 to 10 do
write(a[i],' ');
max:=a[1];
for i:=1 to 10 do
if a[i]>max then
Begin
max:=a[i];
n:=i;
end;
max:=0;
for i:=1 to n-1 do
max:=max+a[i];
writeln;
writeln(max);
End.
Не забудьте сказать