请问以下两道VB题目怎么做1.单击分解按钮,程序提示输入一个大于2的整数,并将该数分解为因数的乘积,代码如下Private Sub Command1_Click() Dim n As Integer, Factor As Integer Dim First As Boolean Do n

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 04:52:35
请问以下两道VB题目怎么做1.单击分解按钮,程序提示输入一个大于2的整数,并将该数分解为因数的乘积,代码如下Private Sub Command1_Click()   Dim n As Integer, Factor As Integer   Dim First As Boolean      Do      n
xT[oA+'$Mv[,R[H-IojfYLF+ %"RSgRvi}A'ݙs97SCho`kSfki^Fgy=x}dݪY}OK,jѭ_f(:h:]hwYc2:^4Nz;k:.CyPh&d>O9AR 7Du!.uEThEc% XP/Kie,qFXᅎZ0;Ak%=tjgS7FD"{H 3$

请问以下两道VB题目怎么做1.单击分解按钮,程序提示输入一个大于2的整数,并将该数分解为因数的乘积,代码如下Private Sub Command1_Click() Dim n As Integer, Factor As Integer Dim First As Boolean Do n
请问以下两道VB题目怎么做
1.单击分解按钮,程序提示输入一个大于2的整数,并将该数分解为因数的乘积,代码如下
Private Sub Command1_Click()
Dim n As Integer, Factor As Integer
Dim First As Boolean

Do
n = InputBox("请输入一个大于2的整数")
If n

请问以下两道VB题目怎么做1.单击分解按钮,程序提示输入一个大于2的整数,并将该数分解为因数的乘积,代码如下Private Sub Command1_Click() Dim n As Integer, Factor As Integer Dim First As Boolean Do n
Option Explicit
Private Sub Command1_Click()
Dim n As Integer, Factor As Integer
Dim First As Boolean

Do
n = InputBox("请输入一个大于2的整数")
If n 2

Factor = 2
First = True

Do
Do While (n Mod Factor = 0)
If First Then
Text1.Text = Str(n) + Space(1) + "=" + Str(Factor)
First = False
Else
Text1.Text = Text1.Text + Space(1) + "*" + Str(Factor)
End If
n = n / Factor
Loop
Factor = Factor + 1
Loop Until Factor > n
End Sub
Private Sub Cmd1_Click()
Dim a(), n%, i%, j%, k%
n = InputBox("请输入控制正方形图案层数的可变数")
ReDim a(n, n)
For k = 1 To (n + 1) \ 2
For i = k To n - k + 1
For j = k To n - k + 1
a(i, j) = k
Next j
Next i
Next k

For i = 1 To n
For j = 1 To n
Print Tab(j * 3); a(i, j);
Next j
Print
Next
End Sub