For i = 0 To 2 For n = 0 To 2 For x = 0 To 2 Select Case i '最外层循环代表a根据i3种不同状态对a进入不同赋值 Case 0 a = 4000 Case 1 a = -2000 Case 2 a = 3000 End Select Select Case n '依次代表b,c根据n,x3种不同状态对b,c进入不同赋值 Case 0 b = 3000 Case 1 b = -2000 Case 2 b = 1000 End Select Select Case x Case 0 c = 5000 Case 1 c = -2000 Case 2 c = 3000 End Select yy = i + n + x '用一个变量把每次结果存储起来 jg(yy) = a + b + c Next Next
Next