def peach(n):
if n == 10:
return 1
else:
return (peach(n+1)+1)*2
print(peach(8))
执行该程序段后,输出的结果是( )
s = "abcxyz"
q = [1,2,3] + [0] * 10
head , tail = 0 , 3
res = ""
for i in s :
c = chr ((ord(i) - ord("a") + q [head]) % 26 + ord("a"))
res += c
q [tail] = q [head]
head = head + 1
tail = tail + 1
print(res)
执行该程序段后,输出的结果是( )
tmps = [32,28,26,29]
n = len (tmps) ; top = -1
an s = [0] * n
stk = [-1] * n
for i in range(n):
t = tmps[i]
while top > -1 and t > tmps[stk[top]] :
d = stk[top]
top -= 1
an s[d] = i - d
top += 1
stk[top] = i
print(an s)
执行该程序段后,输出的结果是( )