摘要: nums = input("请输入多个数,以空格分隔:") num_list_bin = bytes(bytearray.fromhex(nums)) print(num_list_bin) sum = 0 for num in num_list_bin: sum += num #sum &= 0x 阅读全文
posted @ 2024-07-29 08:58 不折不扣 阅读(3) 评论(0) 推荐(0) 编辑
摘要: nums = input("请输入多个数,以空格分隔:") num_list_bin = bytes(bytearray.fromhex(nums)) sum = 0 for num in num_list_bin: sum ^= num print("输入的数的和为:", hex(sum)) 阅读全文
posted @ 2024-07-29 08:53 不折不扣 阅读(12) 评论(0) 推荐(0) 编辑
摘要: nums = input("请输入多个数,以空格分隔:") num_list_bin = bytes(bytearray.fromhex(nums)) for num in num_list_bin: print(hex(num),",", end=" ") 阅读全文
posted @ 2024-07-29 08:45 不折不扣 阅读(26) 评论(0) 推荐(0) 编辑