?? practice7_10.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "打印楊輝三角"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a() As Double, n As Double
Private Sub Form_click()
Form1.Cls
n = InputBox("請輸入行數(shù)", "行數(shù)", "0")
ReDim a(1 To n, 0 To n) As Double
For i = 1 To n
a(i, 0) = 0
a(i, 1) = 1
a(i, i) = 1
For j = 1 To i - 1
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
Next j
Next i
For i = 1 To n
For j = 1 To i
Print Format(a(i, j), "!@@@@@@");
Next j
Print
Next i
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -