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 a, ans As Integer Input #1, n For i = 1 To n Input #1, x a = Len(x) b = 0 c = 0 ans = 0 For y = 1 To a Step 2 b = Val(Mid(x, y, 1)) ans = ans + b Next For j = 2 To a Step 2 c = Val(Mid(x, j, 1)) ans = ans - c Next If ans Mod 11 = 0 Then Print #2, "1" Else Print #2, "0" End If Next Close Close 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 Input #1, n For i = 1 To n c = 0 ans = 0 Input #1, X a = Len(X) For k = 1 To a Step 2 c = Val(Mid(X, k, 1)) ans = ans + c Next k
For j = 2 To a Step 2 c = Val(Mid(X, j, 1)) ans = ans - c Next j If ans Mod 11 = 0 Then Print #2, "1" Else Print #2, "0" End If Next i Close #2 Close #1 End End Sub
Private Sub Form_Load() Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As 2 Input #1, x For i = 1 To x Input #1, n a = Len(n) b = 0 c = 0 ans = 0
For j = 1 To a Step 2 b = Val(Mid(n, j, 1)) ans = ans + b Next j
For k = 2 To a Step 2 c = Val(Mid(n, k, 1)) ans = ans - c Next k
If ans Mod 11 = 0 Then Print #2, "1" Else Print #2, "0" End If Next i Close #2 Close #1 End End Sub
Private Sub Form_Load() Dim b() As String Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, s For j = 1 To s Input #1, r ReDim b(Len(r)) d = 0 e = 0 For i = 1 To Len(r) b(i) = Val(Mid(r, i, 1)) If i Mod 2 = 0 Then d = b(i) + d Else e = b(i) + e End If Next i If (d - e) Mod 11 = 0 Or d - e = 0 Then Print #2, 1 Else Print #2, 0 End If Next j 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
Dim a, ans As Integer
Input #1, n
For i = 1 To n
Input #1, x
a = Len(x)
b = 0
c = 0
ans = 0
For y = 1 To a Step 2
b = Val(Mid(x, y, 1))
ans = ans + b
Next
For j = 2 To a Step 2
c = Val(Mid(x, j, 1))
ans = ans - c
Next
If ans Mod 11 = 0 Then
Print #2, "1"
Else
Print #2, "0"
End If
Next
Close
Close
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
Input #1, n
For i = 1 To n
c = 0
ans = 0
Input #1, X
a = Len(X)
For k = 1 To a Step 2
c = Val(Mid(X, k, 1))
ans = ans + c
Next k
For j = 2 To a Step 2
c = Val(Mid(X, j, 1))
ans = ans - c
Next j
If ans Mod 11 = 0 Then
Print #2, "1"
Else
Print #2, "0"
End If
Next i
Close #2
Close #1
End
End Sub
Private Sub Form_Load()
回覆刪除Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As 2
Input #1, x
For i = 1 To x
Input #1, n
a = Len(n)
b = 0
c = 0
ans = 0
For j = 1 To a Step 2
b = Val(Mid(n, j, 1))
ans = ans + b
Next j
For k = 2 To a Step 2
c = Val(Mid(n, k, 1))
ans = ans - c
Next k
If ans Mod 11 = 0 Then
Print #2, "1"
Else
Print #2, "0"
End If
Next i
Close #2
Close #1
End
End Sub
Private Sub Form_Load()
回覆刪除Dim b() As String
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, s
For j = 1 To s
Input #1, r
ReDim b(Len(r))
d = 0
e = 0
For i = 1 To Len(r)
b(i) = Val(Mid(r, i, 1))
If i Mod 2 = 0 Then
d = b(i) + d
Else
e = b(i) + e
End If
Next i
If (d - e) Mod 11 = 0 Or d - e = 0 Then
Print #2, 1
Else
Print #2, 0
End If
Next j
Close #2
Close #1
End
End Sub