确定数字根据它们的和与异或 [英] Determine numbers based on their sum and xor
本文介绍了确定数字根据它们的和与异或的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我们知道两个数之和XOR,这样,我们才能找出是两个数字?
If we know the sum and XOR of two numbers, then can we find out what are the two numbers?
我试图解决一个问题,上述问题是其中的一部分。虽然,我确实有这个问题另一种解决办法,但我还是想了一个解决方案。
I am trying to resolve a problem and the above problem is a part of that. Although, I do have another solution for that problem but I still want a solution for this.
推荐答案
没有。
例:SUM = 7,XOR = 7
可能的答案:
一)1,6
b)2名,5
C)3,4
Example: SUM=7, XOR=7
Possible answers:
a) 1, 6
b) 2, 5
c) 3, 4
没有足够的信息来决定哪个对(a,b或c)是原始的数字对
Not enough information to decide which pair (a, b or c) is the original pair of numbers.
这篇关于确定数字根据它们的和与异或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文