Joke Collection Website - Joke collection - Interpretation of VB problem! ! !

Interpretation of VB problem! ! !

Option explicit

Private Sub-Form _Click ()

Dim N is an integer, I is an integer, k 1 is an integer, k2 is an integer, k3 is an integer, and k4 is an integer.

Dim bb () is an integer, and Jsq is an integer.

Let's start the calculation.

N = Val(InputBox ("Please enter a number"))

If N< 1 or N>, then 70.

MsgBox "The number entered must be between 1-70!"

outlet connection

If ... it will be over.

Redimb bb (1 to n,1to N+0 to n)' defines the array bb (number of rows and columns).

Jsq = 1

For I = 1 to n \ 2+IIF ((nmod2) = 0,0, 1)' If the number of cycles is odd, add one cycle.

The first lap I= 1.

For the number of columns from k 1 = i to N-i+ 1', subtract the number of turns from the first column to the total number of columns and add one.

Bb(i, k 1) = Jsq' array (number of rows and columns in the first lap) = counter.

Jsq = Jsq+ 1' counter plus 1.

then

For k2 = i+ 1 to N-i+ 1', the number of rows is from the first row plus 1 to the total row minus the number of turns plus 1.

Bb(k2, N-i+ 1) = Jsq' array (row number, total column number minus circle number plus one) = counter.

Jsq = Jsq+ 1' counter plus 1.

then

For k3 = N-i to step i-1' the total number of columns minus the number of columns from circle to circle series.

Bb(N-i+ 1, k3) = Jsq' array (number of rows minus one, number of columns) = counter.

Jsq = Jsq+ 1' counter plus 1.

then

Fork4 = n-i to i+ 1step- 1' The number of rows is reduced from the total number of rows to the number of turns plus one.

Bb(k4, i) = Jsq' array (number of rows, number of turns) = counter.

Jsq = Jsq+ 1' counter plus 1.

then

then

Start the output below.

For lines i = 1 to n'

For the number of columns k 1 = 1 to n'

Print bb(i, k1); I changed it to; No, so the interval between the data is not big, there is no, and the interval is very large.

then

print

then

End joint

In fact, if you analyze the number that loses more, you will find that he is actually increasing the number according to a circle, and each circle is shrinking.