VB数组元素交换
发布网友
发布时间:2023-11-07 07:55
我来回答
共2个回答
热心网友
时间:2024-10-25 01:20
下面是交换代码,A是数组,
Dim A(10) AS Long
Dim I as Long
Dim N as Long
For I=1 to 10
A(I)=Input("请输入整数")
Next I
For I=1 to 5
N=A(11-I)
A(11-I)=A(I)
A(I)=N
Next I
热心网友
时间:2024-10-25 01:20
Dim mArr(10) AS integer
Dim I%,n%,k%
For I=1 to 10
marr(I)=Input("请输入整数")
Next I
print join(marr,", ")
For k=1 to 5
N=A(11-i)
A(11-i)=A(i)
A(i)=N
Next k
print join(marr,", ")