const n=5;var t:array[1..n,1..n] of integer;i,j,p,k:integer;beginRandomize;writeln('Исходный массив:');for i:=1 to n do begin for j:=1 to n do begin t[i,j]:=random(50); write(t[i,j]:4); end; writeln; end;p:=1; k:=0;for i:=1 to n do begin if t[i,i] mod 5 = 0 then p:=p*t[i,i]; if t[i,n-i+1] mod 2 = 0 then k:=k+1; end;writeln('p = ',p,' k = ',k);end.Пример:Исходный массив:
30 16 33 25 423 2 11 14 4511 29 22 48 636 21 35 37 427 14 44 13 29p = 30 k = 3