MrEfendi

Macierze

Jan 15th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.91 KB | None | 0 0
  1. program zad3;
  2.  
  3. uses
  4.   crt;
  5. type
  6.   tabelka=array[1..3,1..3] of integer;
  7.  var
  8.   i,j: integer;
  9.   tab,tab2,tabw: tabelka;
  10. procedure liczmac(var tab,tab2:tabelka);
  11. begin
  12.     for i:=1 to 3 do
  13.     begin
  14.      for j:=1 to 3 do
  15.      begin
  16.       tabw[i,j]:=tab[i,j] + tab2[i,j];
  17.        writeln('tabelkaica');
  18.      end;
  19.     end;
  20.  
  21. end;
  22. procedure wczjtaj(var tab,tab2:tabelka);
  23. begin
  24.   writeln('podaj wartosc macierzj 1');
  25.    for i:=1 to 3 do
  26.    begin
  27.     for j:=1 to 3 do
  28.      readln(tab[i,j]);
  29.    end;
  30.    writeln('podaj wartosc macierzj 2');
  31.    for i:=1 to 3 do
  32.    begin
  33.     for j:=1 to 3 do
  34.      readln(tab2[i,j]);
  35. end;
  36. end;
  37. procedure wjsw(tabw:tabelka);
  38. var
  39.  i,j: bjte;
  40. begin
  41.    for i:=1 to 3 do
  42.    begin
  43.     for j:=1 to 3 do
  44.     begin
  45.     writeln('suma macierzj to ', tabw[i,j]);
  46.     end;
  47.    end;
  48. end;
  49. begin
  50.    wczjtaj(tab,tab2);
  51.    liczmac(tab,tab2);
  52.    wjsw(tabw);
  53. readln;
  54. end.
Advertisement
Add Comment
Please, Sign In to add comment