Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

¡i°ÝÃD¡j¤@­Óºtºâªkªº°ÝÃD

0 views
Skip to first unread message

天下第一怪才

unread,
Aug 10, 2000, 3:00:00 AM8/10/00
to
解答(vb)
Sub Convert(pos, a, b, c)

pos = pos - 1

row = Int((-6 + Sqr(36 + 24 * pos)) / 12)
pos = pos - 6 * row * (row + 1)

tri = pos \ (row + 1)
col = pos Mod (row + 1)

a = tri + 1 '光環
b = row + 1 '圈數
c = col + 1 '個數

End Sub

Private Sub Form_Activate()
Dim num As Long
Open "in.txt" For Input As #1
Open "out.txt" For Output As #2
Do While Not EOF(1)
Input #1, num
If num = 0 Then End: Exit Sub
If num = 1 Then
Input #1, n
Convert n, a, b, c
Print #2, CStr(a); CStr(b); CStr(c)
Else
Input #1, n1, n2, n3
Convert n1, a1, b1, c1
Convert n2, a2, b2, c2
Convert n3, a3, b3, c3
If a1 <> a2 And a2 <> a3 And a3 <> a1 Then
Print #2, "True"
Else
Print #2, "False"
End If
End If
Loop
Close #1
Close #2
End
End Sub

--
[m [1;37m◢ [32m◣◢ [0;32m◣ [1;37m松山高中松江水綠 [0;37m◆作者 [1;37mXMAN [m
[1;32m◢█ [0;32m█◣ [0;37mbbs.sssh.tp.edu.tw (203.72.64.8) ◆來自 [32mu13-166.user.giga.net.tw [m

天下第一怪才

unread,
Aug 10, 2000, 3:00:00 AM8/10/00
to
解答(vb)
Private Sub Form_Activate()

Open "in.txt" For Input As #1
Open "out.txt" For Output As #2
Do While Not EOF(1)
Input #1, num
If num = 0 Then Exit Do
For i = 1 To num
Input #1, word
ReDim a(Len(word))
For k = 0 To Len(word)
a(k) = ""
Next k
temp = 1: flags = 0
For j = 1 To Len(word)
If Mid(word, j, 1) = "(" Or Mid(word, j, 1) = "[" Then
a(j) = Mid(word, j, 1)
temp = j
Else
If Mid(word, j, 1) = "]" And a(temp) = "[" Or Mid(word, j, 1) = ")" And a(temp) = "(" Then
a(temp) = ""
temp = temp - 1
Else
flags = 1
End If
End If
Next j
If flags = 0 Then
Print #2, "Yes"
Else
Print #2, "No"
End If
Next i
0 new messages