-
长方体的表面积及体积(调用函数).txt下载
资源介绍
#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;
}