Определить и напечатать количество положительных элементов в каждом столбце — Pascal(Паскаль)

const n=5;
var a:array[1..n,1..n]of integer;
    i,j,imax:integer;
begin
randomize;
for i:=1 to n do
begin
   for j:=1 to n do
   begin
      a[i,j]:=random(21)-10;
      write(a[i,j]:4);
   end;
   writeln;
end;
for j:=1 to n do
begin
   imax:=1;
   for i:=1 to n do
   if a[i,j]>a[imax,j] then imax:=i;
   writeln('max в ',j,' стобце: ',a[imax,j]);
end;
readln;
end.

Leave a Comment

2 + 8 =