Current location - Quotes Website - Personality signature - Private Sub command 1_click() Dim i#, j#, k#, x# For i = 1 to 4 x = 4 For j = 1 to 3 x = 3 For k = 1
Private Sub command 1_click() Dim i#, j#, k#, x# For i = 1 to 4 x = 4 For j = 1 to 3 x = 3 For k = 1
This is a triple loop controlled by I, J and K. I do it four times, J does it three times and K does it twice. K does J once every 2 times, and J does I once every 3 times, until I complete 4 cycles, with a total of 4*3*2=24 cycles.

Do two loops here for k = 1 to 2 //. First, x=3 (from the previous sentence, it can be known that for k = 1to2, x=x+6 for the first time, then x=x+6 for the second time, and x = 15 (here k did it twice).

Next, do a cycle of J. At this time, after x=3 initializes X from 15 to 3, there will be two cycles of K again until the three cycles of J are over, and the program jumps to start the cycle of I again. . Move back and forth until i=4, and the program sequentially inputs:

x = 4

For j = 1 to 3

x = 3

For k = 1 to 2

x = x + 6

For the last time, print x= 15.