result
窗体中有文本框为Text1和Text2。运行程序时单击"运行"按钮Command1,在Text1中输入整数m(m>0),在Text2中显示输出m的全部除1和自身之外的因子。例如,20的因子有2,4,5,10,输出结果为"2,4,5,10,";16的因子为2,4,8,输出结果为"2,4,8,"。
事件代码如下:
Private Sub Command1_Click()
m = Val(Me!Text1)
resule = ""
k = 2
Do
If m Mod k = 0 Then result = result & k & ","
k = k + 1
Loop While 【 】
Me!Text2 = result
End Sub
程序【 】处应填写的语句是
在窗体中有文本框Text1和Text2。运行程序时,在Text1中输入整数m(m>0),单击Command1"运行"按钮,程序能够求出m的全部除1之外的因子,并在Text2显示结果。例如,18的全部因子有2,3,6,9,18,输出结果为"2,3,6,9,18,";28的全部因子为2,4,7,14,28,输出结果为"2,4,7,14,28"。
事件代码如下:
Private Sub Command1_Click()
m = Val(Me!Text1)
resule = ""
For k = 2 To 【 】
If m Mod k = 0 Then
result = result & k & ","
End If
Next k
Me!Text2 = result
End Sub
程序【 】处应填写的语句是