vb交换数组
发布网友
发布时间:2024-10-07 09:59
我来回答
共2个回答
热心网友
时间:2024-10-07 10:15
从键盘里读入10个数
for i = 1 to 10
input data( i );
next i
for i = 1 to 5
tmp = data( i )
data( i ) = data( 10 - i + 1 )
data( 10 - i + 1 ) = tmp
next i
for i = 1 to 10
print data( i ),
next i
输入一个5*5方阵
for i = 1 to 5
for j = 1 to 5
input data( i, j )
result = 1
for i = 1 to 5
result = result * data( i, i )
next i
print result;
热心网友
时间:2024-10-07 10:15
楼上正解~
顺带一提~
next的后面不要跟个i,多循环时会严重影响速度~~切记切记~~