1 class Solution {
2 public:
3 vector<int> twoSum(vector<int>& nums, int target)
4 {
5 bool mark = true;
6 vector<int>ret;
7 for (int i = 0; mark && i < nums.size(); i++)
8 {
9 for (int j = 0; mark && j < nums.size(); j++)
10 {
11 if (i == j)continue;
12 if (nums[j] == target - nums[i])
13 {
14 ret.push_back(i);
15 ret.push_back(j);
16 mark = false;
17 }
18 }
19 }
20 return ret;
21 }
22 };