擅长:python、mysql、java
<p>多亏了所有人。现在,我的代码是通过简单地将raw_input更改为input()来运行的。
数据=[]</p>
<p>n=int(input('输入需要的元素数:')</p>
<p>对于范围(0,n)内的i:</p>
<pre><code>x = input('Enter the numbers into the array: ')
data.append(x)
</code></pre>
<p>k=已排序(数据)</p>
<p>打印(k)</p>
<p>定义lSearch(k,s):</p>
^{pr2}$
<p>s=int(input('输入要搜索的元素:')</p>
<p>结果=lSearch(k,s)</p>
<p>如果结果==-1:</p>
<pre><code>print("The Element is not found")
</code></pre>
<p>其他:</p>
<pre><code>print("The element is an array at index %d",result)
</code></pre>