Form a triangle


Submit solution

Points: 50 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

題目說明

請輸入三個數字,判斷三個數字是否能構成三角形。

三角形不等式:三個邊長,任意兩個邊的和皆大於第三邊,則這三條邊可以構成三角形。
ex:三個邊:3、4、5。
3+4>5
3+5>4
4+5>3,所以可以構成三角形!

輸入

三個數字(正整數即可)。
*每輸入一個數字記得按空白鍵間格起來

輸出

依照題目說明判斷三個數字是否能夠成三角形
可以則輸出> These sides can form a triangle.
不行則輸出> These sides cannot form a triangle.

範例輸入 #1

2 3 4

範例輸出 #1

These sides can form a triangle.

範例輸入 #2

1 1 2

範例輸出 #2

These sides cannot form a triangle.

範例輸入 #3

3 2 1

範例輸出 #3

These sides cannot form a triangle.

Comments

There are no comments at the moment.