import math
def accont(a,b,c):
a=int(a)
b=int(b)
c=int(c)
P=int((a+b+c)/2)
S=int(math.sqrt(P*(P-a)(P-b)(P-c)))
return S
A=int(input())
B=int(input())
C=int(input())
LIS=[A,B,C]
LIS.sort()
if LIS[0]<LIS[1]+LIS[2] and LIS[0]-LIS[1]<LIS[2]:
RESULT=accont(A,B,C)
print("%.2f"%(RESULT))
else:
print("数据错误")
pass
代码出现非零返回如何解决
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
辉煌仪奇 2021-10-15 11:07关注你在这里出现了语法错误

修改意见,参照下方建议代码修改import math def accont(a, b, c): a = int(a) b = int(b) c = int(c) P = int((a + b + c) / 2) S = int(math.sqrt(P * (P - a)*(P - b)*(P - c))) return S A = int(input()) B = int(input()) C = int(input()) LIS = [A, B, C] LIS.sort() if LIS[0] < LIS[1] + LIS[2] and LIS[0] - LIS[1] < LIS[2]: RESULT = accont(A, B, C) print("%.2f" % (RESULT)) else: print("数据错误")有帮助请采纳,有问题继续交流,你的采纳是对我回答的最大的肯定和动力
本回答被专家选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用