编写计算等腰三角形面积的程序

5 Sept 2024 | 2 分钟阅读

在用不同的编程语言编写计算等腰三角形面积的程序之前,首先我们需要了解什么是计算等腰三角形面积的公式?

什么是等腰三角形的面积?

用不同编程语言计算等腰三角形面积的程序

程序 1:用 C 语言编写程序

以上 C 程序的输出

Enter the height of the Isosceles Triangle:5
Enter the base b of the Isosceles Triangle:10
Area of the Isosceles Triangle is: 25.00

程序 2:用 Java 语言编写程序

以上 Java 程序的输出

The Area of Isosceles Triangle in Java:
25.0

程序 3:用 PHP 编程语言编写程序。

以上 PHP 程序的输出

24

程序 4:用 Python 编程语言编写程序。

以上 Python 程序的输出

250.0