rayhanf

contoh_2dimensi

Apr 18th, 2023
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.45 KB | Source Code | 0 0
  1. program _2dimensi;
  2. uses crt;
  3.  
  4. type
  5.     matriks= array [1..3, 1..3] of integer;
  6. var
  7.     a: matriks;
  8.     i, j, m, n: shortint;
  9.  
  10. begin
  11.     clrscr;
  12.     write('Masukkan banyak baris: ');
  13.     readln(m);
  14.     write('Masukkan banyak kolom: ');
  15.     readln(n);
  16.  
  17.     for i:=1 to m do
  18.         for j:=1 to n do begin
  19.             write('A[', i, ',', j, ']: ');
  20.             readln(a[i,j])
  21.         end;
  22.     for i:=1 to m do begin
  23.         for j:=1 to n do begin
  24.             write(a[i,j]:2, ' ':2);
  25.         end;
  26.         writeln;
  27.     end;
  28. end.
Add Comment
Please, Sign In to add comment