已知有一批书1020本,以后每天都卖掉一半还多2本,写程序求几天能卖完?(vb)

2024-12-05 02:40:42
推荐回答(1个)
回答1:

'8天
Private Sub Command1_Click()
i = 1020
j = 0
Do While i > 0
j = j + 1
i = i / 2 - 2
Loop
MsgBox "用了" & j & "天!"
End Sub