Skip to content

Commit 32cff9c

Browse files
Bruce YangBruce Yang
authored andcommitted
Clean.
1 parent fbf19d8 commit 32cff9c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

cpp-leetcode/test.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
#include<vector>
2-
#include<array>
32
#include<algorithm>
43
#include<iostream>
4+
#include<bits/stdc++.h>
55
using namespace std;
66

7-
class Solution {
8-
public:
9-
int getSum(int a, int b) {
10-
unsigned int carry;
11-
while (b != 0) /* 把b先拿过去加一次, 后面用b存储每一次的进位值 */
12-
{
13-
carry = (a & b) << 1; /* 单独处理进位 */
14-
a ^= b; /* 对位相加, 不处理进位的部分 */
15-
b = carry;
16-
}
17-
return a;
18-
}
19-
};
7+

0 commit comments

Comments
 (0)