python3 加入输出范围检测
进制转换
https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
while True: try: st1 = str(input()) dec_value = int(st1, 16) if 1 > dec_value or 2**31-1 < dec_value: print("数据超出数据范围,请重新输入。") else: print(dec_value) except: break