#include <bits/stdc++.h> using namespace std; int main() { int n_tests; cin >> n_tests; int points = 0; int tests_to_pass = n_tests / 10; for (int i = 0; i < n_tests/tests_to_pass; i++) { bool did_pass = true; for (int j = 0; j < tests_to_pass; j++) { char test; cin >> test; if (test == 'N') did_pass = false; } if (did_pass) points++; } cout << points << endl; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <bits/stdc++.h> using namespace std; int main() { int n_tests; cin >> n_tests; int points = 0; int tests_to_pass = n_tests / 10; for (int i = 0; i < n_tests/tests_to_pass; i++) { bool did_pass = true; for (int j = 0; j < tests_to_pass; j++) { char test; cin >> test; if (test == 'N') did_pass = false; } if (did_pass) points++; } cout << points << endl; } |