怎么解决调用sub出现“语句未结束”错误?
课程设计
1
Dim n,a
n=Int(InputBox("n"))
a=Split("0 "&InputBox("a()"))
For i=1 To n
For j=i+1 To n
If a(j)<a(i) Then
swap a(j) a(i)
End If
Next
Next
MsgBox(Join(a))
Sub swap(byRef x,byRef y)
Dim z
z=x
x=y
y=z
End Sub
-
Sub swap(ByRef x, ByRef y) Dim z z = x x = y y = z End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim n, a n = Int(InputBox("n")) a = Split("0 " & InputBox("a()")) For i = 1 To n For j = i + 1 To n If a(j) < a(i) Then swap(a(j), a(i)) End If Next Next MsgBox(Join(a)) End Sub
-
Sub swap(ByRef x, ByRef y) Dim z z = x x = y y = z End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim n, a n = Int(InputBox("n")) a = Split("0 " & InputBox("a()")) For i = 1 To n For j = i + 1 To n If a(j) < a(i) Then swap(a(j), a(i)) End If Next Next MsgBox(Join(a)) End Sub
发表回复