用C ++查找二十面体的面积和体积的程序
例
#include <bits/stdc++.h>
using namespace std;
//寻找区域
float findArea(float a) {
float area;
area = 5 * sqrt(3) * a * a;
return area;
}
//查找量
float findVolume(float a) {
float volume;
volume = ((float)5 / 12) * (3 + sqrt(5)) * a * a * a;
return volume;
}
int main() {
float a = 5;
cout << "Area: " << findArea(a) << endl;
cout << "Volume: " << findVolume(a);
return 0;
}输出结果
Area: 216.506 Volume: 272.712
热门推荐
10 女朋友考试祝福语简短
11 简短的出行工作祝福语
12 下雪宝宝生日祝福语简短
13 新婚贺词简短的祝福语
14 同事男生节祝福语简短
15 虎年新年专属祝福语简短
16 新年祝福语和语句简短
17 怎么说祝福语简短
18 老师送的祝福语简短