This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
这不是
break
关键字工作的方式。它结束switch
语句,而不是程序。在您的代码中,如果该选项为
是
,则是
和否
代码将被执行,因为没有break> break
否
之前。您可能想要这样的东西:
That is not the way the
break
keyword works. It ends theswitch
statement, not the program.In your code, if the option is
yes
, bothyes
andno
codes will be executed because there is nobreak
before theno
.You probably want something like that: