We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85c82a4 commit d3bbd57Copy full SHA for d3bbd57
Spoj/TOANDFRO.py
@@ -0,0 +1,14 @@
1
+cols = int(input())
2
+while cols!=0:
3
+ cadena = input()
4
+ rows = int(len(cadena)/cols)
5
+ aux = [cadena[i*cols:i*cols+cols] for i in range(rows)]
6
+ for i in range(len(aux)):
7
+ if i % 2:
8
+ aux[i] = aux[i][::-1]
9
+ rta =''
10
+ for x in range(cols):
11
+ for fil in aux:
12
+ rta+=fil[x]
13
+ print(rta)
14
+ cols = int(input())
0 commit comments