先不论答案正确与否, 总是提示编译出错 请问如何改正谢谢
int searchInsert(int* nums, int numsSize, int target){
int left=0;
int right=0;
int middle=0;
right=numsSize-1;
middle=left+(right-left)/2;
while(left<=right)
{
if(nums[middle]<target)
{
left=middle+1;
}else if(nums[middle]>target)
{
right=middle-1;
}else if(nums[middle]==target)
{
middle=middle-1;
return middle;
}
}
}