编一段程序:梯形上底A=13,下底B=18,高H=9,求它的面积S

来源:百度知道 编辑:UC知道 时间:2024/06/06 07:00:04
要求是Turbo Pascal 7.0的

function mianji(A,B,H:double): double;
begin
result :=(A+B)*H/2;
end;

294.5
Press any key to continue

#include<iostream>
using namespace std;

main() {
int A = 13, B = 18, H = 19;
double S;
S = 0.5 * ( A + B ) * H;
cout<<S<<endl;
}

知道