Advertisement
Spocoman

01. Trapeziod Area

Aug 31st, 2023 (edited)
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double b1, b2, h;
  7.     cin >> b1 >> b2 >> h;
  8.     double result = (b1 + b2) * h / 2;
  9.  
  10.     cout.setf(ios::fixed);
  11.     cout.precision(2);
  12.    
  13.     cout << result << endl;
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement