1234567891011121314 |
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- double U, D, H, slope, area, perimeter;
- cin >> U >> D >> H;
- area = (U + D) * H / 2;
- slope = hypot((D - U) / 2, H);
- perimeter = U + D + 2 * slope;
- cout << fixed << setprecision(2) << area << endl;
- cout << fixed << setprecision(2) << perimeter << endl;
- return 0;
- }
|