-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroll_your_matrix.py
More file actions
61 lines (61 loc) · 1.68 KB
/
roll_your_matrix.py
File metadata and controls
61 lines (61 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def main():
n =input()
n=n.split(' ')
if int(n[0])==1:
n1 = input()
n1 = n1.split(' ')
s={}.fromkeys([x for x in range(int(n[1]))],[])
for i in range(int(n[1])):
temp=[]
temp.append(n1[i])
s[i]=temp
for j in range(int(n[1])):
print(' '.join(s[j]))
if int(n[0])==3:
n1 = input()
n1 = n1.split(' ')
n2 = input()
n2 = n2.split(' ')
n3 = input()
n3 = n3.split(' ')
s={}.fromkeys([x for x in range(int(n[1]))],[])
for i in range(int(n[1])):
temp=[]
temp.append(n1[i])
temp.append(n2[i])
temp.append(n3[i])
s[i]=temp
for j in range(int(n[1])):
print(' '.join(s[j]))
if int(n[0])==2:
n1 = input()
n1 = n1.split(' ')
n2 = input()
n2 = n2.split(' ')
s={}.fromkeys([x for x in range(int(n[1]))],[])
for i in range(int(n[1])):
temp=[]
temp.append(n1[i])
temp.append(n2[i])
s[i]=temp
for j in range(int(n[1])):
print(' '.join(s[j]))
if int(n[0])==4:
n1 = input()
n1 = n1.split(' ')
n2 = input()
n2 = n2.split(' ')
n3 = input()
n3 = n3.split(' ')
n4=input()
n4=n4.split(' ')
s={}.fromkeys([x for x in range(int(n[1]))],[])
for i in range(int(n[1])):
temp=[]
temp.append(n1[i])
temp.append(n2[i])
temp.append(n3[i])
temp.append(n4[i])
s[i]=temp
for j in range(int(n[1])):
print(' '.join(s[j]))