Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Thu Nov 19 20:09:32 2020
- @author: Sergey
- """
- import math
- def check(a,b,c):
- if (a + b >= c) and (a+c>=b) and (b+c>=a):
- return True
- else:
- return False
- def sq(a,b,c):
- p=(a+b+c)/2
- S = math.sqrt(p*(p-a)*(p-b)*(p-c))
- return S
- a,b,c,d=float(input()),float(input()),float(input()),float(input())
- data=[a,b,c,d]
- ans=-1
- for i in range(4):
- for j in range(i+1,4):
- for k in range(j+1,4):
- if check(data[i],data[j],data[k]):
- ans = max(ans,sq(data[i],data[j],data[k]))
- if ans == -1:
- print('Таких треугольников нет')
- else:
- print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement