用于计算十二面体的表面积的 C++ 程序
什么是十二面体?
单词‘十二面体’源自希腊语,其中十二面体表示‘十二’,而 hedra 表示‘面’。在几何中,十二面体是具有十二个平面的 3D 柏拉图或规则立体。与其他图形一样,十二面体也具有以下性质: -
- 20 个多面体顶点
- 30 条多面体边
- 12 个五角面,五角形是五边形
下面给出的是十二面体的图像

问题
给定一个棱,该程序必须找到十二面体的表面积,其中表面积是给定图形的面占用的总空间。
为了计算十二面体的表面积,有一个公式,即:

示例
Input-: side=5 Output-: 516.143
算法
Start Step 1 -> declare function to find area of dodecahedron double area(int side) return ((3 * sqrt(25 + 10 * (sqrt(5)))) * (pow(side, 2))) Step 2 -> In main() Declare variable int side=5 Print area(side) Stop
代码
#include <bits/stdc++.h>
using namespace std;
//function to find area of dodecahedron
double area(int side){
return ((3 * sqrt(25 + 10 * (sqrt(5)))) * (pow(side, 2))) ;
}
int main(){
int side = 5;
cout<< "Surface area of dodecahedron is : " << area(side);
return 0;
}输出
Surface area of dodecahedron is : 516.143
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP