Private Sub Command1_Click() For i=1 To 4 x=4 For j =1 To 3 x=3 For k=1 To 2 x=x+6 Next k Nex
问题描述:
Private Sub Command1_Click() For i=1 To 4 x=4 For j =1 To 3 x=3 For k=1 To 2 x=x+6 Next k Nex
为什么只是加到第二步
答
因为你每个循环都初始化x的值你一个x=3代码把前面加的都作废了
所以只执行最后一个
For k=1 To 2
x=x+6
Next