include iostream using namespace std struct Abiturient char name 256 u

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
using namespace std;
struct Abiturient {
char name[256];
unsigned int remark;
};
int main() {
size_t n;
cout << "Кол-во абитуриентов:\n";
cin >> n;
struct Abiturient *abiturients = new struct Abiturient[n];
for (size_t i = 0; i < n; ++i) {
cout << "Фамилия:\n";
cin >> abiturients[i].name;
cout << "Оценка [1-5]:\n";
cin >> abiturients[i].remark;
}
for (size_t i = 0; i < n; ++i) {
if (abiturients[i].remark > 2)
cout << abiturients[i].name << " (" << abiturients[i].remark << ")" << "\n";
}
delete[] abiturients;
return 0;
}