nums = input("請輸入多個數,以空格分隔:") num_list_bin = bytes(bytearray.fromhex(nums)) sum = 0 for num in num_list_bin: sum ^= num print("輸入的數的和為:", hex(sum))
nums = input("請輸入多個數,以空格分隔:") num_list_bin = bytes(bytearray.fromhex(nums)) sum = 0 for num in num_list_bin: sum ^= num print("輸入的數的和為:", hex(sum))