判断三角形的面积及类型(多重选择)
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 "普通三角形"
运行结果:
相关文章推荐
- C语言-根据输入的三角形的三条边判断三角形的类型,并输出它的面积和类型
- C语言输入三角形边长判断其类型并输出面积实例代码
- C语言 输入三角形的三边,判断三角形的类型,并输出它的类型和面积
- c语言求三角形的面积及判断三角形类型
- 计算三角形的面积,并判断三角形的类型?
- 三角形的类型判断和面积计算
- C语言实现判断三边形成三角形类型并求面积
- 判断三角形类型
- 第六周任务四设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形。
- C++第六周任务4设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形。
- 如何判断三角形能否构成以及三角形的类型
- 判断三角形类型
- 九度oj 1048 判断三角形类型
- 常用选择集使用及判断实体类型
- 判断三角形类型
- [Android实例] 判断网络是否连接,然后选择网络类型(比如wifi等)来连接网络
- //九度OJ 1048 判断三角形类型
- 《C++第六周实验报告4-1》---设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形。
- 九度1048 判断三角形类型
- 设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形