def setup():
m1=[[1,2,3],[4,5,6]]
m2=[[4,2,6],[14,19,15]]
SubtractMatrix(m1,m2)
MultipleMatrix(m1,m2)
def SubtractMatrix(a,b):
print('SubtractMatrix')
i=0
while(i<len(a)):
j=0
while(j<len(a[i])):
print(a[i][j]-b[i][j]," ",end = "")
j=j+1
i=i+1
print("")
def MultipleMatrix(a,b):
print('MultipleMatrix')
i=0
while(i<len(a)):
j=0
while(j<len(a[i])):
print(a[i][j]*b[i][j]," ",end = "")
j=j+1
i=i+1
print("")
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น