在线等~~VB程序设计题。。急

哥哥考弟弟一道数学题,题目是:"有一筐鸡蛋,2个2 个数多1个,3个3个数多2个,4个4个数多3个,5个5个数正好数完,问这筐鸡蛋最少是几个?"
为解决此问题,弟弟编了一个如下Visual Basic程序,其中s表示鸡蛋数,t用于控制循环。但此程序存在两处错误,已分别用划线及(1)、(2)标注。请改正这二处错误,并将正确内容按顺序填写在程序下方(1)和(2)划线处。
Private Sub Command1_Click()
Dim s As Integer, t As Boolean
s = 5
t = False
Do While Not t
s = s + 1
t = (s Mod 2 = 1) And (s Mod 3 = 2) And (s Mod 4 = 3) And (s Mod 5 <> 0) '(1)
Next '(2)
Text1.Text = Str(s)
End Sub

程序中划线处(1)改为
程序中划线处(2)改为

程序中划线处(1)改为 t = (s Mod 2 = 1) And (s Mod 3 = 2) And (s Mod 4 = 3) And (s Mod 5 = 0)

程序中划线处(2)改为 Loop

Private Sub Command1_Click()
Dim s As Integer, t As Boolean
s = 5
t = False
Do While Not t
s = s + 1
t = (s Mod 2 = 1) And (s Mod 3 = 2) And (s Mod 4 = 3) And (s Mod 5 = 0) '(1)
Loop '(2)
Text1.Text = Str(s)
End Sub
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答