|
@@ -2,9 +2,6 @@
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
-void fout(double x, int scale = 6) {
|
|
|
- cout << setiosflags(ios::fixed) << setprecision(scale) << x << endl;
|
|
|
-}
|
|
|
|
|
|
int main(int argc, char const *argv[]) {
|
|
|
double U, D, H, slope, area, perimeter;
|
|
@@ -12,7 +9,7 @@ int main(int argc, char const *argv[]) {
|
|
|
area = (U + D) * H / 2;
|
|
|
slope = hypot((D - U) / 2, H);
|
|
|
perimeter = U + D + 2 * slope;
|
|
|
- fout(area, 2);
|
|
|
- fout(perimeter, 2);
|
|
|
+ cout << fixed << setprecision(2) << area << endl;
|
|
|
+ cout << fixed << setprecision(2) << perimeter << endl;
|
|
|
return 0;
|
|
|
}
|