1 static int wing=[]()
 2 {
 3     std::ios::sync_with_stdio(false);
 4     cin.tie(NULL);
 5     return 0;
 6 }();
 7 
 8 class Solution 
 9 {
10 public:
11     int getSum(int a, int b) 
12     {
13         return b==0?a:getSum(a^b, (a&b)<<1);
14     }
15 };

就是位操作,原理描述起来有点费劲,自行百度吧

posted on 2018-05-26 16:34  高数考了59  阅读(76)  评论(0)    收藏  举报