根据小学梯形面积公式S=0.5∗(a+b)∗hS=0.5*(a+b)*hS=0.5∗(a+b)∗h可以写出代码。
AC Code
#include <bits/stdc++.h> using namespace std; int a, b, h; int main() { cin >> a >> b >> h; cout << 0.5 * (a + b) * h; return 0; }
注册一个 HydroOJ 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 HydroOJ 通用账户