HistoryHistory File metadata and controls Code Blame 7 lines (6 loc) · 160 Bytes Raw 1 2 3 4 5 6 7 base = input("Enter base :-") base = int(base) height = input("Enter height :-") height = int(height) area = (base*height)/2 print("Area of triangle :-",area)Footer...
题目地址:https://leetcode.com/problems/largest-triangle-area/description/ 题目描述 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. Example: Input: points =[[0,0],[0,1 ],[1,0],[0,2 ],[2,0]]Output:2...
Sample Solution: Code: fromcollectionsimportnamedtupleimportmath# Define a Triangle NamedTupleTriangle=namedtuple('Triangle',['side1','side2','side3'])# Function to calculate the area of a triangledeftriangle_area(triangle):print("Sides of the triangle:",triangle.side1,',',triangle.side2,'...
Learn how to calculate the largest triangle area using Python with step-by-step examples and explanations.
master LintCodeInPython/largest-triangle-area.py / Jump to Go to file 22 lines (21 sloc) 896 Bytes Raw Blame class Solution: """ @param points: List[List[int]] @return: return a double """ def largestTriangleArea(self, points):...
The five points are show in the figure below. The red triangle is the largest. Notes: 3 <= points.length <= 50. No points will be duplicated. -50 <= points[i][j] <= 50. Answers within10^-6of the true value will be accepted as correct. ...
Here, we will calculate the area of Sphere using the below formula. area = (float)(4 * Math.PI * radius * radius); C# program to calculate the area of Sphere The source code to calculate the area of Sphere is given below. The given program is compiled and executed successfully on Mic...
https://leetcode.com/problems/largest-triangle-area/ 题目描述 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. Example: Input: points=[[0,0],[0,1],[1,0],[0,2],[2,0]] ...
leetcode 812. 最大三角形面积(Largest Triangle Area)三角形面积公式,程序员大本营,技术文章内容聚合第一站。
Area of Trapezium is: 10.000000 RUN 2: Enter base1: 1 Enter base2: 2 Enter height: 3 Area of Trapezium is: 4.500000 RUN 3: Enter base1: 3 Enter base2: 4 Enter height: 1 Area of Trapezium is: 3.500000 Explanation In the above program, we created two functionscalcuateAreaOfTrapezium(...