擅长:python、mysql、java
<p>每次通过循环时都需要输入一个新字符串。您仅有的代码只输入一个字符串,然后退出或永远打印其反向:</p>
<pre><code>s = input()
while s not in {"quit", "Quit", "q"}:
print (s[::-1])
</code></pre>
<p>您可以将其更改为:</p>
<pre><code>s = input()
while s != "quit":
print (s[::-1])
s = input()
</code></pre>
<p>这将获得一个新的字符串每次通过。你知道吗</p>