您的位置:首页 > 其它

判断三角形的面积及类型(多重选择)

2017-05-14 12:44 381 查看
代码:

# -*- coding:utf-8 -*-
import math
a=input("请输入a边长:")
b=input("请输入b边长:")
c=input("请输入c边长:")
if a>b:
t=a;a=b;b=t
if a>c:
t=a;a=c;c=t
if b>c:
t=b;b=c;c=t
if a+b>c and a+c>b and b+c>a:
print "可以组成三角形"
if a==b and a==c:
print "等边三角形"
elif a == b or a == c or b==c:
print "等腰三角形"
elif a**2+b**2==c**2:
print "直角三角形"
else:
print "普通三角形"

运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐