#include <stdio.h>
int num1[]={2,5,7,9,12,15,18,35};
int twoSum(int* nums, int numsSize);//, int target);//, int* returnSize)
int main() {
printf("我在学C语言\n\n");
twoSum(num1,8);
return 0;
}
int twoSum(int* nums, int numsSize)//,int* num2)//, int target)//, int* returnSize)
{
int i=0;
int j=0;
int k=0;
int* num2;
for(i=0;i<numsSize;i++)
{
for(j=0;j<numsSize;j++)
{
if(i!=j)
{
if(nums[i]+nums[j]==7)
{
num1[k]=i;
num1[k+1]=j;
k+=2;
if(i!=num1[k])
{
printf("num1[%d]=%d,num1[%d]=%d\n\n",k,i,k+1,j);
}
printf("i=%d j=%d\n",i,j);
//printf("nums[%d]=%d,nums[%d]=%d\n",i,nums[i],j,nums[j]);
}
}
}
}
return 0;
}