c**********e 发帖数: 2007 | 1 Write a function to add two numbers, without using any arithmetic operator. |
X****r 发帖数: 3557 | 2 There is really not much point for posting this question here.
The answers are just one Google away.
【在 c**********e 的大作中提到】 : Write a function to add two numbers, without using any arithmetic operator.
|
S*********g 发帖数: 5298 | 3 xentar今天thrust附身啦
【在 X****r 的大作中提到】 : There is really not much point for posting this question here. : The answers are just one Google away.
|
r****t 发帖数: 10904 | 4 这个狗出来的感觉很难啊。要是面的时候我就回答 accumulate/ plus 。
【在 X****r 的大作中提到】 : There is really not much point for posting this question here. : The answers are just one Google away.
|
d****n 发帖数: 1637 | 5 我也以为是那个家伙呢, 一看id不是。哈哈
【在 S*********g 的大作中提到】 : xentar今天thrust附身啦
|
d****n 发帖数: 1637 | 6 狗来的:
#include
int add(int a, int b)
{
if (!a)
return b;
else
return add((a & b) << 1, a ^ b);
}
int main()
{
unsigned int a,b;
printf("Enter the two numbers: \n");
scanf("%d",&a);
scanf("%d",&b);
printf("Sum is: %d",add(a,b));
}
【在 r****t 的大作中提到】 : 这个狗出来的感觉很难啊。要是面的时候我就回答 accumulate/ plus 。
|
p*********t 发帖数: 2690 | 7 老考bitwise operators有意思吗? 那个字有几种写法就那么有意思?
【在 c**********e 的大作中提到】 : Write a function to add two numbers, without using any arithmetic operator.
|
t****t 发帖数: 6806 | 8 对C++来说, 这问得是没什么意思
对硬件工程师来说, 这个属于常识, 也有更复杂的算法基于这个东西.
【在 p*********t 的大作中提到】 : 老考bitwise operators有意思吗? 那个字有几种写法就那么有意思?
|
p*********t 发帖数: 2690 | 9 这其实就是 逻辑设计 里面的 与非,或非 什么的.很少用到的东西.
【在 t****t 的大作中提到】 : 对C++来说, 这问得是没什么意思 : 对硬件工程师来说, 这个属于常识, 也有更复杂的算法基于这个东西.
|
c****p 发帖数: 6474 | 10 用逻辑运算?
【在 c**********e 的大作中提到】 : Write a function to add two numbers, without using any arithmetic operator.
|