题解 | #字符串加解密#

字符串加解密

https://www.nowcoder.com/practice/2aa32b378a024755a3f251e75cbf233a

l=input()
L=input()
ll=""
LL=""
for i in l:
    if i=="9":
        i="/"
    if i=="Z":
        i="@"
    if i=="z":
        i="`"
    i = chr(ord(i) + 1)
    if i==i.lower():
        i=i.upper()
    else:
        i=i.lower()
    ll=ll+i
for i in L:
    if i=="0":
        i=":"
    if i=="a":
        i="{"
    if i=="A":
        i="["
    i = chr(ord(i) - 1)
    if i==i.lower():
        i=i.upper()
    else:
        i=i.lower()
    LL=LL+i
print(ll)
print(LL)

全部评论

相关推荐

MinJerous:虽然我一直说 计算机不怎么卡学历 但是至少得一本
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务