```python import math # 获取三角形的三条边长 a = float(input()) b = float(input()) c = float(input()) # 判断能否构成三角形 if a + b > c and a + c > b and b + c > a: # 计算周长 circumference = a + b + c # 计算半周长 s = circumference / 2 # 计算面积 area = math.sqrt(s * (s - a) * (s - b) * (s - c)) print("The circumference of the triangle is {:.1f}.".format(circumference)) print("The area of the triangle is {:.1f}.".format(area)) else: print("Can't form a triangle.") # 额外注意的逻辑点: # 1. 输入的边长要确保是有效的数值。 # 2. 计算面积时,要注意半周长的计算和开方运算的准确性。 # 3. 对于异常输入(如非数值)需要进行适当的错误处理。 ``` [2025-03-13 10:55:58 | AI写代码神器 | 243点数解答]