确定数字根据它们的和与异或它们的、根据、数字

2023-09-11 02:46:12 作者:姐木心,肿么记伱

如果我们知道两个数之和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.