三角形中内接圆的面积( C程序)?
在这里,我们将看到内接于等边三角形的圆的面积。三角形的边长为“a”。

等边 三角形的面积为 -

三角形的半周长为 -

所以,圆的半径为 -

示例
#include <iostream>
#include <cmath>
using namespace std;
float area(float a) {
if (a < 0 ) //if the value is negative it is invalid
return -1;
float area = 3.1415 * (a/(2*sqrt(3))) * (a/(2*sqrt(3)));
return area;
}
int main() {
float a = 4;
cout << "Area is: " << area(a);
}输出
Area is: 4.18867
广告
数据结构
网络化
关系数据库管理系统 (RDBMS)
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP