《剑指OFFER》-和为S的两个实数
和为S的两个数字
http://www.nowcoder.com/questionTerminal/390da4f7a00f44bea7c2f3d19491311b
class Solution { public: vector<int> FindNumbersWithSum(vector<int> array,int sum) { vector<int> ret; if(array.size()<=0)return ret; for(int i = 0; i<array.size();i++) { for(int j = i+1; j<array.size();j++) { if(array[i]+array[j]==sum) { ret.push_back(array[i]); ret.push_back(array[j]); return ret; } } } return ret; } };