Java 代码
class Solution
{
public int[] findNumbersWithSum(int[] nums, int target)
{
int[] re = null;
for (int i = 0; i < nums.length; i ++)
{
for (int j = i; j < nums.length; j++)
{
if (nums[i] + nums[j] == target)
{
re = new int[]{nums[i], nums[j]};
break;
}
}
if (re != null)
break;
}
return re;
}
}