133.Učitati dvodimenzionalni niz - matricu nxm. Prebrojati i ispisati koliko ima parnih elemenata po redovima.

Opis programa:

Tekstualni algoritam:

Listing programa:

PROGRAM p10915015;
USES
  WinCrt;
VAR
i,j, n, m, br : INTEGER;
X : ARRAY [1..15,1..15] OF INTEGER;
broj : ARRAY [1..15] OF INTEGER;
BEGIN WRITE('n m ='); {dimenzije matrice} READLN(n,m); WRITELN('Ulaz niza'); FOR i := 1 TO n DO {ulaz} FOR j := 1 TO m DO BEGIN WRITE('X[',i,',',j,']='); READLN(X[i,j]); END; FOR i := 1 TO n DO {izlaz} BEGIN WRITELN; FOR j := 1 TO m DO WRITE(X[i,j]:4); END; WRITELN; br := 0; FOR i := 1 TO n DO BEGIN broj[i]:=0; FOR j := 1 TO m DO if X[i,j] mod 2 = 0 then broj[i] := broj[i] + 1; WRITELN('broj[',i,']=',broj[i]); END; END.

Izvođenje programa:

Index