Загрузка данных



#include <iostream>
#include <cmath>
using namespace std;

double f(double x1, double y1, double x2, double y2) {
    return sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
}

double f(double R, double r, double h) {
    return (M_PI * h / 3.0) * (R*R + R*r + r*r);
}

int main() {
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << f(x1, y1, x2, y2) << endl;

    double R, r, h;
    cin >> R >> r >> h;
    cout << f(R, r, h) << endl;

    return 0;
}
```