VAR D : array [1..7,1..7] of real; s: real; i,j: Byte; begin s:=0; FOR i:=1 TO 7 DO FOR j:=1 TO 7 DO D[ i,j]:= RANDOM(10); FOR i:=1 TO 7 DO begin FOR j:=1 TO 7 DO WRITE ( D[ i,j]);WRITEln(); end; FOR i:=1 TO 7 DO FOR j:=1 TO 7 DO if i=j then s:=s+D[i,j]; WRITEln('s=',s); end.
begin
s:=0;
FOR i:=1 TO 7 DO
FOR j:=1 TO 7 DO D[ i,j]:= RANDOM(10);
FOR i:=1 TO 7 DO
begin
FOR j:=1 TO 7 DO
WRITE ( D[ i,j]);WRITEln();
end;
FOR i:=1 TO 7 DO
FOR j:=1 TO 7 DO if i=j then s:=s+D[i,j];
WRITEln('s=',s);
end.