109.1..Učitati dvodimenzionalni niz. Ispisati članove matrice koji nisu djeljive sa 3.

Opis programa:

Tekstualni algoritam:

Listing programa:

PROGRAM p10911025;
USES
  WinCrt;
VAR
 i, j, n, m: INTEGER;
  X : ARRAY [1..15,1..15] OF INTEGER;
BEGIN
  WRITE('n, m =');
  READLN(n,m);
  FOR i := 1 TO n DO  
    FOR j := 1 TO m DO
      BEGIN
        WRITE('X[',i,',',j,']=');
        READLN(X[i,j]);
      END;
  FOR i := 1 TO n DO 
    BEGIN
      WRITELN;
      FOR j := 1 TO m DO
        IF X[i,j] MOD 3 <> 0 THEN
           WRITE(X[i,j]:4)
        ELSE
           WRITE('   ');
    END;
END.

Izvođenje programa:

Index