【文件属性】:
文件名称:长方体的表面积及体积(调用函数).txt
文件大小:461B
文件格式:TXT
更新时间:2022-12-25 14:57:57
C++ 调用函数
#include
using namespace std;
double S(double a, double b, double c);
double V(double a, double b, double c);
void main()
{
double a, b, c;//长宽高
cout << "请输入长,宽及高:";
cin >> a >> b >> c;
cout << "表面积为:" << S(a, b, c) << endl;
cout << "体积为:" << V(a, b, c) << endl;
}
double S(double a, double b, double c)
{
return 2 * (a * b + a * c + b * c);
}
double V(double a, double b, double c)
{
return a * b * c;
}