(1)先对数组进行快速排序 (2)左右指针查找 void findSumEqualTarget(int[] arr, int target,int len) { int first = 0; int last = len-1; int sum = 0; while(first < last ) { sum = arr[first] + arr[last]; if (sum == target) { printf("%d,%d",arr[first],arr[last]); first++; last--; } else if (sum < target) { first++; } else { last--; } } }