求教,为什么十个错了一半啊
查看原帖
求教,为什么十个错了一半啊
1172980
Onychophora楼主2024/11/3 18:17
def func(x):
    if ord(x)==65 or ord(x)==97:
        decode=chr(ord(x)+25)
        return decode
    elif 65<ord(x)<=90 or 97<ord(x)<=122:
        decode=chr(ord(x)-1)
        return decode
    else:
        return x
def g(x):
    a=[]
    b=''
    for i in x:
        a.append(func(i))
    for i in a:
        b+=i
    return b
s=input().split()
for i in s:
    print(g(i),end =" ")
2024/11/3 18:17
加载中...