文章

326

粉丝

4

获赞

551

访问

240.0k

头像
数字反转 题解:
P1276 上海交通大学机试题
发布于 2026年1月
阅读数 592

def fun(x):
    m=str(x)
    mm=m[::-1]
    return mm
while(1):
    try:
        sm=list(map(int,input().split()))
        m=sm[0]
        n=sm[1]
        count1=m+n
        # print(count1)
        mm=int(fun(m))
        nn=int(fun(n))
        # print(mm)
        # print(nn)
        count2=mm+nn
        if(int(fun(count1))==int((count2))):
            print(count1)
        else:
            print("NO")
    except:
        break

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发