文章

311

粉丝

3

获赞

352

访问

44.4k

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

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

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发