s = input('请输入一串小写字母') head = 0; tail = 0; top = -1 s1 = [""]*((len(s)+1)//2)
s2 = [""]*(len(s)//2)
for i in range(len(s)):
if i % 2 == 0:
s1[tail] = s[i]
tail += 1
else:
top += 1
s2[top] = s[i] x = ""
while head < tail and top > -1:
x = s1[head] + x
head += 1
x = x + s2[top]
top -= 1 print(x)
执行该程序段,输入字符串“abcdefg”,则输出的结果是( )