代码如下:
- Return an array of size *returnSize.
-
Note: The returned array must be malloced, assume caller calls free().
/
int twoSum(int* numbers, int numbersSize, int target, int* returnSize) {
int i=0;
int j=numbersSize-1;
while(numbers[i]+numbers[j]!=target)
{
if(numbers[i]+numbers[j]>target)
{
j=j-1;
}
else
{
i=i+1;
}
}returnSize[0]=i+1;
returnSize[1]=j+1;
return returnSize;
}
运行的时候出不来结果啊,请问这是为什么,我该怎么改呢?