用VB求解 已知A,B为正整数,A

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 01:20:23
用VB求解 已知A,B为正整数,A

用VB求解 已知A,B为正整数,A
用VB求解 已知A,B为正整数,A

用VB求解 已知A,B为正整数,A
这个不难,你只要好好分析下就会做了
Private Sub Form_Load()
Dim tempA As Integer
Dim tempB As Integer
Dim B As Integer
Dim sum As Integer
Dim little As Integer
little = 2698
For tempA = 1 To 2698
tempB = 2698 / tempA
If tempA < tempB And 2698 Mod tempA = 0 Then
sum = tempA + tempB
End If
If sum < little Then
little = sum
B = tempB
End If
Next tempA
MsgBox B
End Sub