您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

在C程序中,将等边三角形内切圆的面积计算出来

2024/3/25 23:04:40发布12次查看
在这里我们将看到等边三角形内切圆的面积。三角形的边是“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
以上就是在c程序中,将等边三角形内切圆的面积计算出来的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product