109.1..
Učitati dva dvodimenzionalna niza i drugi čiji je opšti član: y ij = xij + 3 (dodaj 3). Ispisati oba niza.
Opis programa:
Tekstualni algoritam:
Listing programa:
PROGRAM p10912019;
USES WinCrt;
VAR i,j, n, m : INTEGER;
X, y, C : ARRAY [1..15,1..15] OF INTEGER;
BEGIN
WRITE('n m ='); {dimenzije matrice}
READLN(n,m);
WRITELN('Matrica X');
FOR i := 1 TO n DO {ulaz X[i,j]}
FOR j := 1 TO m DO
BEGIN
WRITE('X[',i,',',j,']=');
READLN(X[i,j]);
END;
WRITELN('Matrica Y');
FOR i := 1 TO n DO {formiranje matrice Y}
FOR j := 1 TO m DO
Y[i,j] := (X[i,j]) + 3;
WRITELN('Izlaz matrica X');
FOR i := 1 TO n DO {izlaz}
BEGIN
FOR j := 1 TO m DO
WRITE(X[i,j]:4);
WRITELN;
END;
WRITELN('Izlaz matrica Y');
FOR i := 1 TO n DO {izlaz}
BEGIN
FOR j := 1 TO m DO
WRITE(Y[i,j]:4);
WRITELN;
END;
END.
Izvođenje programa:
Index
|
|