2017-02-20 23:04发布
'打开系统“记事本”并复制如下内容,保存为abc.txt,重命令为abc.vbs后双击运行。或者,复制到vb6.0环境运行。
Dim a, b, c, m, n, min, max
n = 210
m = Int(Sqr(n))
min = n + 2
max = 0
For a = 1 To m
For b = 1 To m
If n Mod a * b = 0 Then
c = n / (a * b)
If a * b * c = n Then
If a + b + c > max Then max = a + b + c
If a + b + c < min Then min = a + b + c
End If
Next
MsgBox "最大值:" & max & " 最小值:" & min
最多设置5个标签!
'打开系统“记事本”并复制如下内容,保存为abc.txt,重命令为abc.vbs后双击运行。或者,复制到vb6.0环境运行。
Dim a, b, c, m, n, min, max
n = 210
m = Int(Sqr(n))
min = n + 2
max = 0
For a = 1 To m
For b = 1 To m
If n Mod a * b = 0 Then
c = n / (a * b)
If a * b * c = n Then
If a + b + c > max Then max = a + b + c
If a + b + c < min Then min = a + b + c
End If
End If
Next
Next
MsgBox "最大值:" & max & " 最小值:" & min
一周热门 更多>