倒不如试试我这个,简单点。 private sub command1_click() dim n as integer, max as integer, min as integer dim i as integer for i = 1 to 3 n = inputbox("输入第一个数") if i = 1 then max = n: min = n if n > max then max = n elseif n < min then min = n end if next print "最大值为:"; max, "最小值为:"; min end sub本回答被提问者采纳