注册 登录
编程论坛 VB6论坛

可以帮我看一下后面的部分为什么实现不了吗

语成峰 发布于 2013-04-18 16:05, 442 次点击
Private Sub Command1_Click()
Dim a, b, c(7), i%, j%
a = Array(1, 3, 5, 2, 4, 18, 50, 25)
b = Array(5, 27, 30, 35, 60, 41, 87, 33)
For i = 0 To 7
  c(i) = a(i) + b(i)
Next
Print "第一个数组为:"
Print Join(a, ", ")
Print "第二个数组为:"
Print Join(b, ", ")
Print "两个数组相对元素相加的结果为:"
Print Join(c, ", ")
  For j = i + 1 To 6
    If c(i) <= c(j) Then
  temp = c(i)
  c(i) = c(j)
  c(j) = temp
  Print "相加的结果的降序为:"
  Print Join(c, ",")
   End If

Next
End Sub
1 回复
#2
风吹过b2013-04-18 17:29
Dim a, b, c(7), i%, j%
Dim temp

a = Array(1, 3, 5, 2, 4, 18, 50, 25)
b = Array(5, 27, 30, 35, 60, 41, 87, 33)
For i = 0 To 7
  c(i) = a(i) + b(i)
Next
Print "第一个数组为:"
Print Join(a, ", ")
Print "第二个数组为:"
Print Join(b, ", ")
Print "两个数组相对元素相加的结果为:"
Print Join(c, ", ")
  For j = i + 1 To 6
    If c(i) <= c(j) Then
  temp = c(i)
  c(i) = c(j)
  c(j) = temp
   End If
Next
  Print "相加的结果的降序为:"             这两句不能放到循环里面,应该放到循环外面。
  Print Join(c, ",")
1