暴力破解
nums = [2,7,13,15] target = 17 for i in range(len(nums)): for j in range(i+1,len(nums)): if nums[i] + nums[j] == target: print(i,j)