|
程序:
Private Sub CommandButton1_Click()
Dim x As Integer
Dim y As Integer
x = 1
y = 1
l = 2
With Sheet1
.Cells.Clear
.Cells(1, 1) = "x"
.Cells(1, 2) = "y"
For x = 1 To 100
For y = 1 To 100
If 1 / x + 1 / y = 2 / 3 Then
.Cells(l, 1) = x
.Cells(l, 2) = y
l = l + 1
End If
Next y
Next x
End With
End Sub
计算结果:
x y
2 6
3 3
6 2
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2025-12-20 13:07
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社