题解 | 进制转换

进制转换

https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6

import sys

s = list(map(lambda x: int(x, 16), input().split()))#关键之处

l = len(s)
res = 0
x = 0
total = 16**x  # 使用幂运算代替按位异或 注意符号
for i in s:
    res = res + total * i

print(res)

全部评论
点赞 回复 分享
发布于 03-22 12:51 北京

相关推荐

评论
点赞
收藏
分享

创作者周榜

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