Matrix Product by olf

r=raw_input
g=range
while 1:
 a=[map(int,r().split())]
 n=len(a[0])/2
 for i in g(n-1):a+=[map(int,r().split())] 
 for i in g(n):print" ".join(map(str,[sum(a[i][k]*a[k][n+j] for k in g(n)) for j in g(n)]))
 r("\n")

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page