s=input("输入字符串:")
n=len(s)
i=0;j=n-l
ans=" "
while i<n//2 and j>=n//2: -
if s[i]>=s[j]:
ans+=s[i];j-=l
elif s[i]<s[j]:
ans+=s[j];i+=l
print(ans)
执行该程序段,分别输入下列选项中的字符串,输出结果不为“ppp”的是( )
A."python" | B."public" | C."purple" | D."bookshop" |

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

