Advertisement
PedroPauloFO

Eh triangulo

Jun 4th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # Programacao 1, 2014.1 Pedro Paulo
  2. # Eh triangulo
  3.  
  4. import math
  5.  
  6. lado1 = int(raw_input())
  7. lado2 = int(raw_input())
  8. lado3 = int(raw_input())
  9.  
  10. perimetro = (lado1 + lado2 + lado3)
  11. soma = lado2 + lado3
  12. quad_diferenca = (lado2 - lado3)**2
  13.  
  14.  
  15. if lado1 < soma and lado1 > math.sqrt(quad_diferenca):
  16.     print "triangulo valido. %d" % perimetro
  17.  
  18. else:
  19.     print "triangulo invalido."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement