C/C++

Срочно!!! Помогите пожалуйста написать код к задачке на с++! Заранее спасибо!

 #include  
#include
using namespace std;
double min_temp(double* data, const size_t n) {
auto mt = data[0];
for (size_t i = 1; i < n; ++i) {
if (data[i] < mt) {
mt = data[i];
}
}
return mt;
}
size_t negative(double* data, const size_t n) {
size_t count = 0;
for (size_t i = 0; i < n; ++i) {
if (data[i] < 0) {
++count;
}
}
return count;
}
double max_temp(double* data, const size_t n) {
auto mt = data[0];
for (size_t i = 1; i < n; ++i) {
if (data[i] > mt) {
mt = data[i];
}
}
return mt;
}
int main() {
cout > n;
const size_t m = 7;
double* table[m]{};
string days[]{ "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс" };
size_t day = 0;
for (auto& row : table) {
row = new double[n];
cout > row[i];
++day;
}
auto mint = min_temp(table[0], n);
auto neg = negative(table[5], n);
neg += negative(table[6], n);
auto maxt = max_temp(table[0], n);
day = 0;
for (size_t i = 1; i < m; ++i) {
auto next = max_temp(table[i], n);
if (next > maxt) {
maxt = next;
day = i;
}
}
auto sum = 0.0;
for (auto& row : table) {
sum += row[0];
}
auto avg = sum / m;
cout
Андрей Березенко
Андрей Березенко
95 394
Лучший ответ