Другие языки программирования и технологии

Помогите составить программу в Pascal

Дан массив x(n,m) найти номер той строки, которая содержит наибольшее количество положительных элементов.
Заранее спасибо)
var
a: array[1..10,1..10] of integer;

i, j, m, n, max, jmax: integer;

Begin
Write('сколько строк?'); Readln(m);
Write('сколько столбцов?'); Readln(n);

For i:=1 to m do
begin
For j:=1 to n do
begin
write('a[',i,',',j,']='); readln (a[i,j]);
end;
end;

For i:=1 to m do
begin
For j:=1 to n do
write(a[i,j]:3,' ');{Тут можно красиво матрицу вывести, но я не совсем помню как}
end;
writeln;

for i:=1 to n do
begin
a[i,j]:=0;
for j:=1 to m do
if a[i,j]>0 then a[i,j]:=a[i,j]+1;
end;
max:=a[1,1]; jmax:=1;
For j:=2 to n do
begin
if a[i,j]>max then
begin
max:=a[i,j]; jmax:=j;
end;
end;
writeln('Наибольшее количество положительных элементов в ',jmax , 'строке');
end.
Владимир Крючков
Владимир Крючков
331
Лучший ответ
program q199814650;
type
 TMax = record
  Index: Integer;
  Value: Integer;
 end;
var
 i, j, m, k: Integer;
 max: TMax = (Index: -1; Value: 0);
 a: array of array of Integer;
begin
 Randomize;
 SetLength(a, Succ(Random(20)));
 m := Succ(Random(20));
 for i := Low(a) to High(a) do
 begin
  k := 0;
  SetLength(a[i], m);
  for j := Low(a[i]) to High(a[i]) do
  begin
   a[i][j] := Random(101) - 50;
   Write(a[i][j]:4);
   Inc(k, Integer(a[i][j] > 0));
  end;
  if (max.Index = -1) or (max.Value < k) then
  with max do begin Index := i; Value := k; end;
  WriteLn;
 end;
 WriteLn(max.Index);
 ReadLn;
end.
ЕД
Евгений Д
64 923
Если нет своих наработок - в одну строку.
Нужен последний на данный момент Pascal ABC.NET (иначе не будет работать отбор с Rows).

Если нужен только номер строки соотв. вместо Max надо Max().Item2
var i,j,n,m, max,c, k: integer;
a: array [1..100,1..100] of integer;
begin
write ('n, m = ');
readln (n, m);
max:=0;
for i:=1 to n do
begin
c:=0;
for j:=1 to m do
begin
a[i,j]:= -50 + random (101);
write (a[i,j]:4);
if a[i,j] > 0 then inc(c);
end;
writeln;
if c>= max then
begin
max:=c;
k:=i;
end;
end;
writeln ('строка с наибольшим количеством положительных элементов = ', k);
end.
Юра Робеж
Юра Робеж
24 309