在这里,我们将了解如何获取圆内的十边形面积。半径已给出。十边形的边是“a”。

众所周知,十边形的边长如下 -

#include <iostream>
#include <cmath>
using namespace std;
float area(float r) {
if (r < 0) //if r is negative it is invalid
return -1;
float area = (5 * pow(r, 2) * (3 - sqrt(5)) * (sqrt(5) + (2 * sqrt(5)))) / 4;
return area;
}
int main() {
float r = 8;
cout << "Area : " << area(r);
}Area : 409.969
以上就是圆内内接十边形的C程序的面积?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号