求圆柱体的体积
代码
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
const float PI =3.14f;
float radius = 4.5f;
float height = 90.0f;
double volume =PI*pow(radius,2)*height;
cout<<"体积是:"<<volume<<endl;
return 0;
}
运行截图
总结
1.#include
2.pow
3.const
4.变量的定义