C++用位移运算符求两数的平均值

1,

((X,Y)+(X | Y))>> 1;

2,

(X&y)+((x^y)>>1);

猜你喜欢

转载自blog.csdn.net/shenaisi/article/details/80791464
今日推荐