home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1989 July
/
64er_Magazin_89-07_1989_Markt__Technik_de_Side_A.d64
/
matrix-mult
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
790b
|
51 lines
3 :
4 rem matrizenmultiplikation
5 rem (w) volker reichard
6 rem (c) 64'er
7 :
10 dima(10,10),b(10,10),c(10,10)
20 :
30 input"zeilen matrix a";z1
35 input"spalten ";s1:print
40 input"zeilen matrix b";z2
45 input"spalten ";s2
47 print
50 :
55 ifs1<>z2thenprint"produkt nicht bildbar!":end
60 :
62 print"matrix a"
65 forzi=1toz1:print"zeile";zi
70 forsi=1tos1
75 inputa(zi,si)
80 nextsi,zi
85 :
90 print:print"matrix b"
95 forzi=1toz2:print"zeile";zi
100 forsi=1tos2
105 inputb(zi,si)
110 nextsi,zi
115 :
116 forz=1tos2
118 fory=1toz1
120 forx=1tos1
125 s(y,z)=a(y,x)*b(x,z)
130 c(y,z)=c(y,z)+s(y,z)
135 nextx,y,z
136 print
137 :
140 print"matrix a"
142 forzi=1toz1
145 forsi=1tos1
150 printa(zi,si);
155 nextsi:print:nextzi
160 print:print"matrix b"
165 forzi=1toz2
170 forsi=1tos2
175 printb(zi,si);
180 nextsi:print:nextzi
185 print:print"produkt a*b"
190 forzi=1toz1
195 forsi=1tos2
200 printc(zi,si);
205 nextsi:print:nextzi