fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, h;
  6. cin >> a >> b >> h;
  7. cout << 0.5 * ( a + b ) * h;
  8. cout.precision (2);
  9. cout << fixed << 0.5 * ( a + b ) * h;
  10. return 0;
  11. }
Success #stdin #stdout 0s 5280KB
stdin
10 5 3
stdout
22.522.50