编写子过程Sub Array(a() As Integer,Ir As Boolean,n As Integer)
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/13 08:32:35
编写子过程Sub Array(a() As Integer,Ir As Boolean,n As Integer)
该过程的功能是该过程的功能是使数组元素左移或者右移若干位.其中参数a()是数组,Ir指示位移方向(Ture向左移,false向右移),n确定移动的位数
利用VB语言编写,
该过程的功能是该过程的功能是使数组元素左移或者右移若干位.其中参数a()是数组,Ir指示位移方向(Ture向左移,false向右移),n确定移动的位数
利用VB语言编写,
直接用关键字Array与VB冲突,所以加个1
过程名用Array1
Private Sub Array1(a() As Integer,Ir As Boolean,n As Integer)
Dim dd() As Integer
Dim L As Integer
Dim U As Integer
Dim i As Integer
Dim K As Integer
L = LBound(a)
U = UBound(a)
ReDim dd(L To U)
If Ir Then '左移
For i = L To U
K = i + n
If K > U - L + 1 Then
K = K Mod (U - L + 1)
End If
dd(i) = a(K)
Next i
Else '右移
For i = L To U
K = i - n
If K
过程名用Array1
Private Sub Array1(a() As Integer,Ir As Boolean,n As Integer)
Dim dd() As Integer
Dim L As Integer
Dim U As Integer
Dim i As Integer
Dim K As Integer
L = LBound(a)
U = UBound(a)
ReDim dd(L To U)
If Ir Then '左移
For i = L To U
K = i + n
If K > U - L + 1 Then
K = K Mod (U - L + 1)
End If
dd(i) = a(K)
Next i
Else '右移
For i = L To U
K = i - n
If K
Function fun(a As Integer,n As Integer) As Integer
Private Sub Form_Click() Dim a As Integer,b As Integer,k As
Function hw(m As Long) As Boolean Dim a As Integer,b As Inte
Private Sub Command1_Click() Dim i As Integer,s As Integer,n
Dim a(9) As Integer,x As Integer,k As Integer,I As Integer R
Dim ia(1 To 10) As Integer,imin As Integer,n As Integer,i As
9^n+2是不是质数vb编程如下Private Sub Command1_Click()Dim a As Integer
vb程序Dim a(1 To 20) As Integer,i As Integer,j As Integer
英语翻译Sub capt(ii As Integer)S = "asdfghjklqwertyuiopzxcvbnm12
帮忙VB试题我怎么想都算不对Private Sub Command1_Click()Dim a As Integer,b
英语翻译Private Sub Form_Click()Dim a(1 To 10) As Integer,i%,max
b求π为啥是错的Private Sub Command1_Click()Dim s As Integer,n As Do