🌈write in front🌈
🧸大家好,我是Aileen🧸.希望你看完之后,能对你有所帮助,不足请指正!共同学习交流.
🆔本文由Aileen_0v0🧸 原创 CSDN首发🐒 如需转载还请通知⚠️
📝个人主页:Aileen_0v0🧸—CSDN博客
🎁欢迎各位→点赞👍 + 收藏⭐️ + 留言📝
📣系列专栏:Aileen_0v0🧸的PYTHON学习系列专栏——CSDN博客
🗼我的格言:"没有罗马,那就自己创造罗马~"
目录
(1)三角形类型
(2)动物名称
(3)平均数
(1)三角形类型
a,b,c = map(float,input().split())
#将 所有的数按照从大到小排序,通过比较大小进行顺序反转
if a < b:a, b = b , a
if a < c:a, c = c , a
if b < c:b, c = c , bif a >= b + c:print("NAO FORMA TRIANGULO")
else:t = b**2 + c**2if a**2 == t:print("TRIANGULO RETANGULO")if a**2 > t:print("TRIANGULO OBTUSANGULO")if a**2 < t:print("TRIANGULO ACUTANGULO")if a == b == c:print("TRIANGULO EQUILATERO")else:if a ==b or b == c:print("TRIANGULO ISOSCELES")
(2)动物名称
#动物
a = input()
b = input()
c = input()
if a == "vertebrado":if b == "ave":if c == "carnivoro":print("aguia")else:print("pomba")else:if c == "onivoro":print("homem")else:print("vaca")if a == "invertebrado":if b == "inseto":if c == "hematofago":print("pulga")else:print("lagarta")else:if c == "hematofago":print("sanguessuga")else:print("minhoca")
(3)平均数
N1, N2, N3, N4 = map(float, input().split())
x = (2 * N1 + 3 * N2 + 4 * N3 + N4) / (2 + 3 + 4 + 1)
print("Media: %.1f" % x)if x >= 7.0:print("Aluno aprovado.")
elif x < 5.0:print("Aluno reprovado.")
elif 5.0 < x < 7.0:print("Aluno em exame.")y = float(input())print("Nota do exame: %.1f" % y)z = (x + y) / 2if z >= 5.0:print("Aluno aprovado.")else:print("Aluno reprovado.")print("Media final: %.1f" % z)