Advertisement
cd62131

area of a triangle

Dec 27th, 2018
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. #!/usr/bin/python3
  2. from math import sqrt
  3. a = float(input('a = '))
  4. b = float(input('b = '))
  5. c = float(input('c = '))
  6. if a < b + c and b < c + a and c < a + b:
  7.     s = (a + b + c) / 2
  8.     print(f'S = {sqrt(s * (s - a) * (s - b) * (s - c))}')
  9. else:
  10.     print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement