Private Sub Command1_Click()
Dim a%, b%, count%
For a = 1 To 19
For b = 1 To 4
If a * 10 + b * 50 = 240 Then
Print a"张10元和"b"张50元"
count = count + 1
End If
Next b
Next a
Print "共有"count"种不同的取法"
End Sub
'1xx47 ,知道这5位数是57或67的倍数,输出所有满足条件的5位数,并统计这样数的个数.
Private Sub Command1_Click()
Dim i%, count%
For i = 10047 To 19947 Step 100
If i Mod 57 = 0 Or i Mod 67 = 0 Then
Print i
count = count + 1
End If
Next
Print "共有"count"个这样的数"
End Sub
'鸡兔同笼共50只,有腿160只,求鸡和兔各多少只?
Private Sub Command1_Click()
Dim x As Integer
Dim y As Integer
h = 50
f = 160
x = 2 * h - f / 2
y = f / 2 - h
MsgBox "鸡的只数为:" &x &vbCrLf &"兔子的只数为:" &y
End Sub
Rem 语言:Visual Basic 6.0
Sub Main() '开始
S = 0
For i = 1 To 50
S = S + i / (i + 1)
Next
MsgBox S, vbInformation, "输出"
End Sub '结束
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)