题解 | #进制转换#
进制转换
http://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
知识点:10进制转16进制: hex(16) ==> 0x10 16进制转10进制: int(‘0x10’, 16) ==> 16
import sys
for line in sys.stdin: a = line.split() for i in a: print(int(i, 16))
进制转换
http://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
知识点:10进制转16进制: hex(16) ==> 0x10 16进制转10进制: int(‘0x10’, 16) ==> 16
import sys
for line in sys.stdin: a = line.split() for i in a: print(int(i, 16))
相关推荐