- 最后登录
- 2024-10-20
- 在线时间
- 2532 小时
- 阅读权限
- 40
- 注册时间
- 2009-5-31
- 积分
- 1370
- 帖子
- 1033
- 精华
- 11
- UID
- 96089
- WCA ID
- 2010JIMO01
- 兴趣爱好
- 破解
- 积分
- 1370
- 帖子
- 1033
- 精华
- 11
- UID
- 96089
- WCA ID
- 2010JIMO01
- 兴趣爱好
- 破解
|
还可以根据题目穷举,结果只有4、5、6一组
Private Sub Command1_Click()
Dim a, b, c As Integer
Dim aa, bb, cc As Double
For i = 2 To 10000
a = i
b = a + 1
c = b + 1
cc = Arccos((a ^ 2 + b ^ 2 - c ^ 2) / (2 * a * b))
bb = Arccos((a ^ 2 + c ^ 2 - b ^ 2) / (2 * a * c))
aa = Arccos((c ^ 2 + b ^ 2 - a ^ 2) / (2 * b * c))
If aa <> 0 And bb / aa = 2 Or cc / aa = 2 Then Print a, b, c
If bb <> 0 And aa / bb = 2 Or cc / bb = 2 Then Print a, b, c
If cc <> 0 And bb / cc = 2 Or aa / cc = 2 Then Print a, b, c
Next i
End Sub
Private Function Arccos(ByVal x As Single) As Single
If x = 0 Then
Arccos = 3.1415926 / 2
Else
Arccos = Atn(Sqr(1 - x ^ 2) / x)
If Arccos < 0 Then
Arccos = Arccos + 3.1415926
End If
End If
End Function |
|