📄 例5.12.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "10枚硬币付给25元"
ClientHeight = 2355
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2355
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Label Label1
Caption = " 取 1元、2元、5元的硬币共10枚,付给25元钱,问有多少种不同的取法?"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 675
TabIndex = 0
Top = 360
Width = 3330
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Show
CurrentX = 0 '确定开始显示的x坐标
CurrentY = 1500 '确定开始显示的y坐标
Print , "5元", "2元", "1元"
n = 0 '记录解的组数
For a = 0 To 10
For b = 0 To 10
c = 10 - b - a
If a + 2 * b + 5 * c = 25 And c >= 0 Then
n = n + 1
Print "("; n; ")", c, b, a
End If
Next b, a
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -