File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include < vector>
3
3
4
+
4
5
using namespace std ;
5
6
7
+
6
8
// 调试开关
7
9
#define __tmain main
8
10
@@ -19,7 +21,9 @@ using namespace std;
19
21
20
22
class Solution
21
23
{
22
- public:
24
+
25
+ public :
26
+
23
27
vector<int > FindNumbersWithSum (vector<int > array,int sum)
24
28
{
25
29
vector<int > res;
@@ -40,7 +44,7 @@ class Solution
40
44
{
41
45
// / 左右夹逼
42
46
// / 同时能保证乘积最小的
43
- // / 和为sum的最大的两个数最接近sqrt(sum)
47
+ // / 和为sum的最大的两个数最接近sqrt(sum)
44
48
res.push_back (array[start]);
45
49
res.push_back (array[end]);
46
50
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include < vector>
3
3
4
+
4
5
using namespace std ;
5
6
7
+
6
8
#define __tmain main
7
9
8
10
#ifdef __tmain
@@ -31,6 +33,7 @@ class Solution
31
33
32
34
int begin = 1 , end = 2 , mid = (sum + 1 ) / 2 ;
33
35
int currSum = begin + end;
36
+
34
37
while (begin < mid && end < sum)
35
38
{
36
39
// / 和正好是sum的话, 就存储下来
You can’t perform that action at this time.
0 commit comments