Const n=10; m=7; var j,i,i_max,s,max:integer; a:array[1..n,1..m]of integer; begin for i:=1 to n do begin writeln; s:=0;i_max:=i;max:=-32768; for j:=1 to m do begin a[i,j]:=random(100)-50; write(a[i,j]:4); s:=s+a[i,j]; end; writeln('i: ',i,' ',s); if s>max then begin i_max:=i; max:=s; end; end; writeln; writeln(i_max,' s: ',max); end.
n=10; m=7;
var
j,i,i_max,s,max:integer;
a:array[1..n,1..m]of integer;
begin
for i:=1 to n do
begin
writeln; s:=0;i_max:=i;max:=-32768;
for j:=1 to m do
begin
a[i,j]:=random(100)-50;
write(a[i,j]:4);
s:=s+a[i,j];
end;
writeln('i: ',i,' ',s);
if s>max then
begin
i_max:=i;
max:=s;
end;
end;
writeln;
writeln(i_max,' s: ',max);
end.