看程序,)private sub form-click()dim a(5,5) as integer,s(5) as i
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/31 11:12:55
看程序,)
private sub form-click()
dim a(5,5) as integer,s(5) as integer
for i=1 to 5
s(i)= 0
for j=1 to 5
m(i,j)=i+j
next j
next i
for each x in s
print x;
next
end sub
private sub form-click()
dim a(5,5) as integer,s(5) as integer
for i=1 to 5
s(i)= 0
for j=1 to 5
m(i,j)=i+j
next j
next i
for each x in s
print x;
next
end sub
for i =1 to 5循环里的s(i)=0表示给s(1)~s(5)赋值都是0.
for i =1 to 5循环里的for j = 1 to 5循环是
再问: 大神,。。。答案不完整啊
再答: 1.你语句里的m(i,j)是不是写错了,因为你上面定义的是a(5,5)啊,都没有定义过m的数组。
2. for each x in s
print x;
next
打印s数组里的每一个元素,for each x in s表示s数组里的每一个元素赋值给x
再问: 对的对的,不好意思啊,大神,过程一定要详细啊,马上要期末考试了,实在是不会啊T-T
再答: for i=1 to 5
for j=1 to 5
a(i,j)=i+j
next j
next i
这段语句主要是给a数组赋值,a数组元素的值等于本身的行下标和列下标的和。
当i=1时:给第一行元素赋值
j = 1,a(1,1)=1+1=2
j = 2,a(1,2)=1+2=3
j = 3,a(1,1)=1+3=4
j = 4,a(1,2)=1+4=5
j = 5,a(1,2)=1+5=6
当i=2时:给第二行元素赋值
j = 1,a(2,1)=2+1=3
j = 2,a(2,2)=2+2=4
j = 3,a(2,1)=2+3=5
j = 4,a(2,2)=2+4=6
j = 5,a(2,2)=2+5=7
依此类推到i=5
数组a的值如下:
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
5 6 7 8 9
6 7 8 9 10
for i =1 to 5循环里的for j = 1 to 5循环是
再问: 大神,。。。答案不完整啊
再答: 1.你语句里的m(i,j)是不是写错了,因为你上面定义的是a(5,5)啊,都没有定义过m的数组。
2. for each x in s
print x;
next
打印s数组里的每一个元素,for each x in s表示s数组里的每一个元素赋值给x
再问: 对的对的,不好意思啊,大神,过程一定要详细啊,马上要期末考试了,实在是不会啊T-T
再答: for i=1 to 5
for j=1 to 5
a(i,j)=i+j
next j
next i
这段语句主要是给a数组赋值,a数组元素的值等于本身的行下标和列下标的和。
当i=1时:给第一行元素赋值
j = 1,a(1,1)=1+1=2
j = 2,a(1,2)=1+2=3
j = 3,a(1,1)=1+3=4
j = 4,a(1,2)=1+4=5
j = 5,a(1,2)=1+5=6
当i=2时:给第二行元素赋值
j = 1,a(2,1)=2+1=3
j = 2,a(2,2)=2+2=4
j = 3,a(2,1)=2+3=5
j = 4,a(2,2)=2+4=6
j = 5,a(2,2)=2+5=7
依此类推到i=5
数组a的值如下:
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
5 6 7 8 9
6 7 8 9 10
Private Sub Command1_Click() Dim i As Integer,s As Integer,n
Private Sub Form_Click() Dim a As Integer,b As Integer,k As
英语翻译Private Sub Form_Click()Dim a(1 To 10) As Integer,i%,max
dim i as integer dim sum as integer sum=0 for i=0 to 5 sum=s
Private Sub Command1_Click() Dim i,j As Integer For i = 3 To
vb程序Dim a(1 To 20) As Integer,i As Integer,j As Integer
帮忙VB试题我怎么想都算不对Private Sub Command1_Click()Dim a As Integer,b
9^n+2是不是质数vb编程如下Private Sub Command1_Click()Dim a As Integer
b求π为啥是错的Private Sub Command1_Click()Dim s As Integer,n As Do
Private Sub Command1_Click() Dim i As Double,M As Double,L A
Dim a(9) As Integer,x As Integer,k As Integer,I As Integer R
33.设有如下程序Private Sub Command1_Click( )Dim sum As Double,x As