C/C++

Помоги пожалуйста с программой в С++

Контрольная помогите пожалуйста написать решение в коде на С++, 9 и 10 задачу
10)

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <string>
#include <array>
using namespace std;
struct Student {
unsigned short birthday;
string name;
array<unsigned short, 5> marks;
private:
friend bool operator<(const Student& a, const Student& b) {
return a.birthday < b.birthday;
}
friend istream& operator>>(istream& inp, Student& s) {
cout << "Ф. И. О.: ";
getline(inp, s.name);
s.birthday = s.integer(inp, "Год рождения: ");
cout << "Введите пять оценок за экзамены: ";
for (auto& mark : s.marks) mark = s.integer(inp);
inp.ignore(numeric_limits<streamsize>::max(), '\n');
return inp;
}
friend ostream& operator<<(ostream& out, const Student& s) {
out << setw(40) << left << s.name << ' '
<< setw(5) << right << s.birthday << " г. р.";
for (auto mark : s.marks) cout << setw(3) << mark;
puts("");
return out;
}
static unsigned short integer(istream& inp, const char* msg = "") {
auto value = 0U;
do {
cout << msg;
inp >> value;
} while (value > numeric_limits<unsigned short>::max());
return value;
}
};
unsigned integer(const char* msg) {
cout << msg;
unsigned value;
cin >> value;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
return value;
}
int main() {
system("chcp 1251 > nul");
auto n = integer("Количество студентов в группе: ");
auto students = new Student[n];
for (auto i = 0U; i < n; ++i) {
cin >> students[i];
puts("");
}
sort(students, students + n);
for (auto i = 0U; i < n; ++i) cout << students[i];
delete[] students;
system("pause > nul");
}
Андрей Бакин
Андрей Бакин
63 707
Лучший ответ
Начните делать, когда застрянете, напишите сюда о том, с чем у вас возникли проблемы и что вы уже сделали и вам тогда обязательно ПОМОГУТ.
Удачи!
КВ
Костя Волков
13 080