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 11#include < iostream>
22#include < vector>
33
4+
45using namespace std ;
56
7+
68// 调试开关
79#define __tmain main
810
@@ -19,7 +21,9 @@ using namespace std;
1921
2022class Solution
2123{
22- public:
24+
25+ public :
26+
2327 vector<int > FindNumbersWithSum (vector<int > array,int sum)
2428 {
2529 vector<int > res;
@@ -40,7 +44,7 @@ class Solution
4044 {
4145 // / 左右夹逼
4246 // / 同时能保证乘积最小的
43- // / 和为sum的最大的两个数最接近sqrt(sum)
47+ // / 和为sum的最大的两个数最接近sqrt(sum)
4448 res.push_back (array[start]);
4549 res.push_back (array[end]);
4650
Original file line number Diff line number Diff line change 11#include < iostream>
22#include < vector>
33
4+
45using namespace std ;
56
7+
68#define __tmain main
79
810#ifdef __tmain
@@ -31,6 +33,7 @@ class Solution
3133
3234 int begin = 1 , end = 2 , mid = (sum + 1 ) / 2 ;
3335 int currSum = begin + end;
36+
3437 while (begin < mid && end < sum)
3538 {
3639 // / 和正好是sum的话, 就存储下来
You can’t perform that action at this time.
0 commit comments