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)
该错误在于
book_choice
switch:您忘记在每种情况下忘记使用
break;
。开关中的默认行为是掉落并执行下一个情况。这意味着您总是最终执行book3()
,并将您的书设置为“ Python编程”
。The error lies in the
book_choice
switch:You forgot to use
break;
after each case. The default behaviour in a switch is to fall through and execute the next case. That means you always end up executingbook3()
and setting your book to"Python Programming"
.