题目如标题:
代码:
li_n=list(map(int,input().split())) #原字符串
li = list(input().split()) #每个字符串的元素个数
lenght=li_n[0]
s=li[0]
ss=[]
n=0
for i in range(1,len(s)+1):
if i % lenght ==0:
ls=s[n:n+lenght]
n=n+lenght
S = ls[::-1] ##翻转字符串
ss.append(S)
reslut=''
for j in ss:
reslut = reslut+j
if len(reslut)
结果:
2
gogogoout
ogogoguot