然後是第二彈
Sub Main()
Dim a, b, c As Integer
Console.Write("輸入三角形第1邊邊長:")
a = Console.ReadLine()
Console.Write("輸入三角形第2邊邊長:")
b = Console.ReadLine()
Console.Write("輸入三角形第3邊邊長:")
c = Console.ReadLine()
If a + b > c And b + c > a And a + c > b Then
If a ^ 2 + b ^ 2 = c ^ 2 Or b ^ 2 + c ^ 2 = a ^ 2 Or a ^ 2 + c ^
2 = b ^ 2 Then
Console.Write("這是一個直角三角形")
ElseIf a ^ 2 + b ^ 2 < c ^ 2 Or b ^ 2 + c ^ 2 < a ^ 2 Or a ^ 2 +
c ^ 2 < b ^ 2 Then
Console.Write("這是一個鈍角三角形")
ElseIf a ^ 2 + b ^ 2 > c ^ 2 And b ^ 2 + c ^ 2 > a ^ 2 And a ^ 2
+ c ^ 2 > b ^ 2 Then
Console.Write("這是一個銳角三角形")
End If
Else
Console.Write("這不是一個三角形")
End If
Console.ReadLine()
End Sub
這個中間的斷行自己調整啊~ 不要直接複製貼上之後問我說怎麼不行 = =
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.133.53.142