写个vb小程序,分值随你``

发布网友 发布时间:2024-09-28 09:42

我来回答

2个回答

热心网友 时间:2024-10-14 15:34

Private Sub Command1_Click()
For x = 1 To 24
If x * 3 + (24 - x) * 4 = 86 Then
Print "三轮车" & x & "辆"
End If
Next
End Sub

Private Sub Command2_Click()
For i = 1 To 50
For j = 1 To 50
If i + j = 50 And (i + 5) / (j + 5) = 4 Then
Print "父亲的年龄是" & i
Print "儿子的年龄是" & j
End If
Next
Next
End Sub

Private Sub Command3_Click()
For i = 1 To 5
s = 1
For j = 1 To i
s = s * j
Next
t = t + s
Next
Print "1!+2!+3!+4!+5!=" & t
End Sub

热心网友 时间:2024-10-14 15:34

Private Sub Command1_Click()
Dim x%, y%
For x = 1 To 24
y = 24 - x
If 4 * x + 3 * y = 86 Then
Print "汽车有" & x & "辆"
Print "摩托车有" & y & "辆"
Exit For
End If
Next x
End Sub

Private Sub Command2_Click()
Dim fa%, za%, fa5%, za5%
For za = 1 To 25
fa = 50 - za
fa5 = fa + 5
za5 = za + 5
If fa5 = za5 * 4 Then
Print "父亲是" & fa & "岁"
Print "儿子是" & za & "岁"
Exit For
End If
Next za
End Sub

Private Sub Command3_Click()
Dim i%, j%, s1%, s%
s = 0
For i = 1 To 5
s1 = 1
For j = 1 To i
s1 = s1 * j
Next j
s = s + s1
Next i
Print s
End Sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com