-
How many are you going to generate?
For example, spawn those ten.
Then ** as follows.
dim n(9)
dim ifor i=0 to 9
n(i)=i
That's it.
If you want the number to be changed, then you can set a text box to get the number inside, and then replace the 9 in it with your variable.
-
1. Use ArrayList to define an array, ArrayList has add, insert methods, you can freely add new data to the array.
2. Add an element to the array, run the array test program, and output the result to the console. Add an array element.
2.The size of the array list is that it actually contains one element:",,
3. If you want to add data to the closed array in batches, you can use addrange to achieve it:
int to add elements in bulk at the end of the arraylist.
4. If you want to add data to the specified position of the array, you can use the insert method to implement it:
88);Add an array element.
5. If you don't use arraylist to define the array, you will find that the array is fixed, so you can manually make the data "longer"; The task of adding data to an array is done with the concat function that concats two arrays, and the toarray function that creates the array function.
6. Pass "x = int toarray(); Add data, run the array test program, and feed the results to the console.
-
A more intuitive example of a two-dimensional array is a queue, such as a queue of 3 rows and 4 columns below: 1 2 3 41 Liu Bei, Zhang Fei, Guan Yu, Zhao Yun.
2 Lu Bu, Huang Zhong, Cao Cao, Kong Ming.
3 Xiao Qiao, Sun Quan, Zhou Yu, Ma Chao.
If you want to use a two-dimensional array to record this team, define an array a(3,4) with 3 rows and 4 columns to record the names of the people in each position.
Each element of the array represents a position, and the value of this element is the name of the person in that position, for example.
a(1,1)="Liu Bei", a(2,2)=Huang Zhong, a(3,4)=Ma Chao.
A one-dimensional array can be understood as a queue with only one row, or only one column is OK.
-
A single variable is used to record the data of a point, and there are no axes;
A one-dimensional array is used to record data on a line, it has a coordinate axis, and the position corresponding to each coordinate value (i.e., the subscript of the array) is the data of a point on the line;
A two-dimensional array is used to record data on a plane, it has two coordinate axes (x-axis and y-axis), and each pair of coordinate values (i.e., the two subscripts of the two-dimensional array) can represent the data at a point in this plane;
A three-dimensional array is used to represent the data in a cube, and it has three coordinate axes (x-axis, y-axis, and z-axis).
Therefore, through variables and arrays, mathematical models such as points, lines, surfaces, and volumes in nature can be recorded and described. Therefore, thinking of the dimensions of an array as axes can help you understand.
There is also an example to help elementary school students understand the concept of arrays:
Suppose there are 27 blocks in the shape of a cube and arrange them in a long serpentine shape, which is a one-dimensional array a (1 to 27); Arranged in a 3*9 plane, it becomes a two-dimensional array a (1 to 3, 1 to 9); A 3*3*3 cube is a three-dimensional array a (1 to 3, 1 to 3, 1 to 3).
It's similar to a calculator.,Numbers can be entered on the interface.,You can also use the keyboard to enter.,Later dedicated**!! >>>More
On the first floor, your method generates an array of controls that can't respond to events.
It's as simple as adding a process to mylog
Add call mylog() to the form load"Launch"Add call mylog() to the form unload"Exit")private sub form_load()call mylog("Launch") >>>More
dim i, j as boolean
i = false >>>More
Mini programsIt is an application that does not require ** installation to use, it realizes the dream of the application "at your fingertips", and the user can open the application by scanning or searching. It also embodies the concept of "use up and go", and users don't have to worry about whether they install too many apps. Apps will be everywhere and ready to use, but without the need to install or uninstall. >>>More