level 1
HZZZXT
楼主
Option Explicit
Dim i(1 To 100) As Integer
Sub putdata(a() As Integer, n As Integer)
Dim sFile As String
sFile = "\result.txt"
Open App.Path & sFile For Output As #1
For i = 1 To n
Print #1, a(i);
Next
Close #1
End Sub
Private Sub Cmd1_Click()
Dim j As Integer
Open "C:\wexam\00000000\in.txt" For Input As #1
For j = 1 To 100
Input #1, i(j)
Text1.Text = Text1.Text & i(j) & Space(5)
Next
Close #1
End Sub
Private Sub Cmd2_Click()
Dim j As Integer
Dim k As Integer
Dim temp As Integer
Dim flag As Boolean
For j = 1 To 100
flag = False
For k = 1 To 100 - j
If i(k) > i(k + 1) Then
temp = i(k)
i(k) = i(k + 1)
i(k + 1) = temp
flag = True
End If
Next
If Not flag Then
Exit For
End If
Next
Text1.Text = ""
For j = 1 To 100
Text1.Text = Text1.Text & i(j) & Space(5)
Next
putdata i, 100
End Sub
二级题库里的 调试后现实类型不匹配 怎么改啊?????????
2010年08月13日 10点08分
1
Dim i(1 To 100) As Integer
Sub putdata(a() As Integer, n As Integer)
Dim sFile As String
sFile = "\result.txt"
Open App.Path & sFile For Output As #1
For i = 1 To n
Print #1, a(i);
Next
Close #1
End Sub
Private Sub Cmd1_Click()
Dim j As Integer
Open "C:\wexam\00000000\in.txt" For Input As #1
For j = 1 To 100
Input #1, i(j)
Text1.Text = Text1.Text & i(j) & Space(5)
Next
Close #1
End Sub
Private Sub Cmd2_Click()
Dim j As Integer
Dim k As Integer
Dim temp As Integer
Dim flag As Boolean
For j = 1 To 100
flag = False
For k = 1 To 100 - j
If i(k) > i(k + 1) Then
temp = i(k)
i(k) = i(k + 1)
i(k + 1) = temp
flag = True
End If
Next
If Not flag Then
Exit For
End If
Next
Text1.Text = ""
For j = 1 To 100
Text1.Text = Text1.Text & i(j) & Space(5)
Next
putdata i, 100
End Sub
二级题库里的 调试后现实类型不匹配 怎么改啊?????????