| 发表于:2008-01-17 19:15:353楼 得分:0 |
a 与 b, c 与 d 是完全对等的,不必从头到尾计算一遍。 dim a as integer,b as integer,c as integer,d as integer dim x as double dim m as long, n as long, tmp as long for m = 20 ^2 to 150 ^ 2 n = m \ x if n > 150 ^ 2 then exit for if n > 20 ^ 2 then debug.print "following (a * b) / (c * d) < " & x tmp = m ^ 0.5 for a = tmp to 20 step -1 b = m \ a if b > 150 exit for if b > = 20 then debug.print "a = " & a, "b = " & b next a debug.print "" tmp = n ^ 0.5 for c = tmp to 20 step -1 d = n \ c if d > 150 exit for if d > = 20 then debug.print "c = " & c, "d = " & d next a debug.print "" end if next m | | |
|