Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
int searchInsert(int* nums, int numsSize, int target) {
int i;
int site=0;
for(i=0;i<numsSize;++i){
if(nums[i]>=target){
site=i;
break;}
}
return site=(i>site)?i:site;//i>site则site=i;否则site=site
}