Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k)
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/08/17 15:18:00
Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k) = 11 - k Next k x = 5 Print m(2 + m(x))
VB的一个程序
VB的一个程序
![Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k)](/uploads/image/z/5441836-4-6.jpg?t=Private+Sub+command1_click%28%29+Dim+m%2810%29+For+k+%3D+1+To+10+m%28k%29)
Private Sub command1_click()
Dim m(10)
For k = 1 To 10
m(k) = 11 - k
Next k
x = 5
Print m(2 + m(x))
这就是个绕弯子的程序,没什么意义,考你的理解能力的.严格的说,这个程序可能有错误,Dim m(10)应该改成Dim m(1 to 10),否则m的下标范围是m(0 to 9),m(10)=11-k会出错误.不谈这个错误,说下程序的意思:
for的循环是给m(1)到m(10)赋值,成为:
m(1)=11-1=10
m(2)=11-2=9
m(3)=11-3=8
m(4)=7
m(5)=6
m(6)=5
m(7)=4
m(8)=3
m(9)=11-9=2
m(10)=11-10=1;
然后赋值x=5
最后m(2+m(x))=m(2+m(5))=m(2+6)=m(8)=3
明白了吗?下次拜托把程序贴到内容栏里,别贴题目上太累眼神了.
Dim m(10)
For k = 1 To 10
m(k) = 11 - k
Next k
x = 5
Print m(2 + m(x))
这就是个绕弯子的程序,没什么意义,考你的理解能力的.严格的说,这个程序可能有错误,Dim m(10)应该改成Dim m(1 to 10),否则m的下标范围是m(0 to 9),m(10)=11-k会出错误.不谈这个错误,说下程序的意思:
for的循环是给m(1)到m(10)赋值,成为:
m(1)=11-1=10
m(2)=11-2=9
m(3)=11-3=8
m(4)=7
m(5)=6
m(6)=5
m(7)=4
m(8)=3
m(9)=11-9=2
m(10)=11-10=1;
然后赋值x=5
最后m(2+m(x))=m(2+m(5))=m(2+6)=m(8)=3
明白了吗?下次拜托把程序贴到内容栏里,别贴题目上太累眼神了.
Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k)
Private Sub Command1_Click() Dim b,k For k=1 to 6 b=23+k Nex
Private Sub Command0_Click() Dim a(10, 10) For m = 2 To 4 Fo
Private Sub Command1_Click() Dim i,j As Integer For i = 3 To
1)private sub command1_click() x=10:y=0 for i=1 to 5 do x=x-
Private Sub Command1_Click() Dim i As Double,M As Double,L A
Private Sub Command1_Click() For i = 1 To 3 For j = i To 1 a
Private Sub Command1_Click() For i = 1 To 3 For j = 1 To i F
Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1
Private Sub Command1_Click() n = 0 For i = 1 To 3 For j = -4
VB编程option base 1private sub command1_click() dim d d=array(
Private Sub Command1_Click() x=0 n=InputBox("") For i=1 To n