C/C++

Помогите написать программу

 #include  
#include
#include

using namespace std;

double input(istream& inp, const string msg) {
cout > value;
inp.ignore(0x1000, '\n');
return value;
}

class Detail {
public:
Detail()
: h(0), r(0), b(0), g(0) {}
Detail(const double h, const double r)
: h(h), r(r), b(0), g(0) {}
void density(const double value) {
g = value;
}
void thickness(const double value) {
b = value;
}
double weight()const {
const auto ov = volume(r);
const auto iv = volume(r - b);
const auto v = ov - iv;
return v * g;
}
private:
double h;
double r;
double b;
double g;
double volume(const double rad)const {
static const auto pi = 3.1415926535897932;
return pi * pow(rad, 2) * h;
}
};

int main() {
cout > n;
auto details = new Detail[n];
if (details == nullptr) exit(1);
const auto h = input(cin, "H: ");
const auto r = input(cin, "R: ");
Detail detail(h, r);
fill(details, details + n, detail);
for (size_t i = 0; i < n; ++i) {
auto txt = to_string(i + 1) + ": ";
details[i].density(input(cin, "G" + txt));
details[i].thickness(input(cin, "B" + txt));
}
const auto p = input(cin, "P: ");
size_t count = 0;
auto sum_weight_all = 0.0;
auto sum_weight = 0.0;
for (size_t i = 0; i < n; ++i) {
auto weight = details[i].weight();
if (weight
Костя Важенин
Костя Важенин
79 783
Лучший ответ
за 300 напишу
Димастый Я
Димастый Я
4 100