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