Dim num1, num2 As Integer Dim sum As Long Dim countt(9) As Integer Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Input #1, num1 Input #1, num2 Close #1
sum = num1 * num2
For i = 1 To Len(Str(sum)) - 1 ok = Mid(sum, i, 1) countt(ok) = countt(ok) + 1 Next
Open App.Path & "\out.txt" For Output As #2 For ii = 0 To 9 If Not countt(ii) = "0" Then Print #2, ii & countt(ii) & " "; End If Next Close #2 End Sub
Private Sub Form_Load() Me.Hide Dim b(9) Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, x, y a = x * y For i = 0 To 9 For j = 1 To Len(a) c = Val(Mid(a, j, 1))
If c = i Then b(i) = b(i) + 1 Next If b(i) <> 0 Then Print #2, i & b(i) & " "; Next Close Close End End Sub
Private Sub Form_Load() Me.Hide Dim c(9) As Long Dim z As Long For i = 0 To 9 c(i) = 0 Next Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, x Input #1, y z = x * y w = Len(Str((z))) For i = 1 To w - 1 num = Mid(z, i, 1) c(num) = c(num) + 1 Next Print #2, z For i = 0 To 9 Print #2, i; c(i) Next Close Close End Sub
Dim num1, num2 As Integer
回覆刪除Dim sum As Long
Dim countt(9) As Integer
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Input #1, num1
Input #1, num2
Close #1
sum = num1 * num2
For i = 1 To Len(Str(sum)) - 1
ok = Mid(sum, i, 1)
countt(ok) = countt(ok) + 1
Next
Open App.Path & "\out.txt" For Output As #2
For ii = 0 To 9
If Not countt(ii) = "0" Then
Print #2, ii & countt(ii) & " ";
End If
Next
Close #2
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Dim b(9)
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, x, y
a = x * y
For i = 0 To 9
For j = 1 To Len(a)
c = Val(Mid(a, j, 1))
If c = i Then b(i) = b(i) + 1
Next
If b(i) <> 0 Then Print #2, i & b(i) & " ";
Next
Close
Close
End
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Dim c(9) As Long
Dim z As Long
For i = 0 To 9
c(i) = 0
Next
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, x
Input #1, y
z = x * y
w = Len(Str((z)))
For i = 1 To w - 1
num = Mid(z, i, 1)
c(num) = c(num) + 1
Next
Print #2, z
For i = 0 To 9
Print #2, i; c(i)
Next
Close
Close
End Sub