price(3,4)是数组price第3行第4列上的 元素
a(1,1) a(1,2) a(1,3) a(1,4) ……a(1,n) a(2,1) a(2,2) a(2,3) a(2,4) ……a(2,n)
a(3,1) a(3,2) a(3,3) a(3,4)……a(3,n)
…… …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… …… ……
相当于 dim 数组变量名(0 to n) as元素类型 其中n为整数常量
dim score(50) as integer
dim score(0 to 50) as integer
精选版课件ppt
11
一维数组用来存储数据的一个线性序列 Dim a(1 to n) as integer a(1) a(2) a(3) a(4) a(5) …… a(n)
多维数组可以存放的数据量: 每一维的数据量的乘积
如 dim price(1 to 5,-1 to 2,4) as double 可以存放的数据个数: 5*4*5=100
精选版课件ppt
14
1、如下数组声明语句,正确的是
(A)Dim a[3,4] As Integer
(B)Dim a(1 to 3,4 to 9) As Integer
A1是数组下标的下界,A2是下标的上界,A1和 A2都是整数常量。 如: dim score(1 to 50) as integer,它包含的元 素有score(1)、score(2)……score(50)
dim strname(-7 to 10) as string,它包含 的元素有score(-7)、score(-6)……score(10) dim 数组变量名(n) as 元素类型