Dim dataa As String Dim countt(9999) As Integer Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, dataa mycount = Split(dataa, " ")
For i = 0 To UBound(mycount) countt(mycount(i)) = countt(mycount(i)) + 1 Next
For ii = 1 To 9 If countt(ii) = 2 Then Print #2, ii Next
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Dim n(19), i As Integer i = 0 Do Until EOF(1) Input #1, n(i) i = i + 1 Loop For j = 0 To UBound(n) 'MsgBox n(j) For k = 0 To UBound(n) - 1 If n(k) > n(k + 1) Then a = n(k) n(k) = n(k + 1) n(k + 1) = a End If Next Next j For p = 0 To 17 Step 3 If n(p) <> n(p + 2) Then Print #2, n(p) Exit For Else End If Next If n(17) <> n(19) Then Print #2, n(19) Close #2 Close #1 End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, x m = Split(x, " ") For i = 0 To UBound(m) b = 1 For j = 0 To UBound(m) If m(i) = m(j) And m(i) <> 0 And i <> j Then b = b + 1: m(j) = 0 Next If b Mod 3 = 2 Then Print #2, m(i) Next Close Close End End Sub
Dim dataa As String
回覆刪除Dim countt(9999) As Integer
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, dataa
mycount = Split(dataa, " ")
For i = 0 To UBound(mycount)
countt(mycount(i)) = countt(mycount(i)) + 1
Next
For ii = 1 To 9
If countt(ii) = 2 Then Print #2, ii
Next
Close #2
Close #1
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Dim n(19), i As Integer
i = 0
Do Until EOF(1)
Input #1, n(i)
i = i + 1
Loop
For j = 0 To UBound(n)
'MsgBox n(j)
For k = 0 To UBound(n) - 1
If n(k) > n(k + 1) Then
a = n(k)
n(k) = n(k + 1)
n(k + 1) = a
End If
Next
Next j
For p = 0 To 17 Step 3
If n(p) <> n(p + 2) Then
Print #2, n(p)
Exit For
Else
End If
Next
If n(17) <> n(19) Then Print #2, n(19)
Close #2
Close #1
End
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, x
m = Split(x, " ")
For i = 0 To UBound(m)
b = 1
For j = 0 To UBound(m)
If m(i) = m(j) And m(i) <> 0 And i <> j Then b = b + 1: m(j) = 0
Next
If b Mod 3 = 2 Then Print #2, m(i)
Next
Close
Close
End
End Sub
程式正確
回覆刪除