109.3..Učitati dvodimenzionalni niz - matricu nxm. Izračunati i ispisati aritmetičku sredinu elemenata parnih redova niza X[n,m]

Tekstualni algoritam:

Listing programa:

PROGRAM p10916014;
USES
  WinCrt;
VAR
  i, j,S, Br : INTEGER;
  As:REAL;
  X : ARRAY [1..15,1..15] OF INTEGER;
  Sred : ARRAY [1..15] OF INTEGER;
  Skol : ARRAY [1..15] OF INTEGER;
BEGIN
  FOR i := 1 TO 5 DO  {ulaz}
    FOR j := 1 TO 5 DO
      BEGIN
        WRITE('X[',i,',',j,']=');
        READLN(X[i,j]);
      END;
    S := 0;
    Br := 0;
     FOR i:= 1 TO 5 DO
   IF i MOD 2=0 THEN 
     BEGIN
     FOR j:= 1 TO 5 DO
  BEGIN
    S := S + X[i,j] ;
    Br := Br + 1 ;
  END;     
 WRITELN('As parnih redova je ',s/br);
 END;     
END.

Izvođenje programa:

Index