Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- struct Subject {
- string name;
- int mark;
- };
- struct Student {
- std::string name;
- Subject subjects[4];
- };
- int main()
- {
- int n;
- cin >> n;
- auto students = new Student[n];
- for (int i = 0; i < n; i++)
- {
- cin >> students[i].name;
- for (int j = 0; j < 4; j++)
- {
- cin >> students[i].subjects[j].name;
- cin >> students[i].subjects[j].mark;
- }
- }
- int result = 0;
- for (int i = 0; i < n; i++)
- {
- bool isFullFive = true;
- for (int j = 0; j < 4; j++)
- {
- if (students[i].subjects[j].mark != 5)
- {
- isFullFive = false;
- break;
- }
- }
- if (isFullFive)
- result++;
- }
- cout << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement