Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
如果您的余额为
x
,则应该能够撤回x
的余额。因此,您应该检查
amt< = balance
,不是如果amt<余额
,因为这不包括amt == balance
的情况。只需更新您的代码:
If you have a balance of
x
, you should be able to withdraw a balance ofx
.Therefore, you should be checking if
amt <= balance
, not ifamt < balance
as this excludes the case whereamt == balance
.Simply update your code to this: