Option Explicit
Private Sub Command1_Click()
Open "c:\1.txt" For Input As #1
Open "c:\2.txt" For Output As #2
Dim n() As Integer
Dim c As Integer
Dim s As String
While Not EOF(1)
ReDim Preserve n(0 To c) As Integer
Line Input #1, s
n(c) = Val(s)
c = c + 1
Wend
Dim i As Integer, j As Integer
Dim Wait As Integer
Dim cc As Integer
Wait = -1
For i = 0 To c - 1
If n(i) Mod 10 = 0 Then
Wait = i
cc = 0
End If
If Wait = -1 Then
Print #2, Trim(Str(n(i)))
Else
If n(Wait + cc) = n(i) Then
cc = cc + 1
If cc = 10 Then
Print #2, Trim(Str(n(Wait) \ 10))
Wait = -1
cc = 0
End If
Else
For j = Wait To i
Print #2, Trim(Str(n(j)))
Next j
End If
End If
Next i
If Wait <>-1 Then
For j = Wait To i - 1
Print #2, Trim(Str(n(j)))
Next j
End If
Close #1
Close #2
End Sub
定义的时候写成了inflie主程序中写成了infile看到没。
而且你这程序应该还不止一个错误吧
我编译的结果
E:\practise\Account\main.cpp||In constructor 'COPY_FILE::COPY_FILE()':|
|error: 'nocreate' is not a member of 'std::ios'|
error: 'abort' was not declared in this scope|
error: 'noreplace' is not a member of 'std::ios'|
error: 'abort' was not declared in this scope|
||=== Build finished: 4 errors, 0 warnings ===|
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)