擅长:python、mysql、java
<p>基本上,您要做的是用python编写C代码。
相反,我将首先尝试关注如何以“pythonic”的方式编写python代码。但对于您的问题,请使用python中的暴力解决:</p>
<pre><code>In [173]: def two_num(arr, t):
...: for i in arr:
...: for j in arr[i + 1: ]:
...: if i + j == t:
...: print(f"{i} + {j} = {t}")
...: return
</code></pre>