#include <iostream> using namespace std; int main() { int n, current = 0, result = 0; string tests; cin >> n >> tests; for (int i = 0; i < 10; i++) { bool is_correct = 1; for (int j = 0; j < n / 10; j++) if (tests[current++] == 'N') is_correct = 0; result += is_correct; } cout << result; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include <iostream> using namespace std; int main() { int n, current = 0, result = 0; string tests; cin >> n >> tests; for (int i = 0; i < 10; i++) { bool is_correct = 1; for (int j = 0; j < n / 10; j++) if (tests[current++] == 'N') is_correct = 0; result += is_correct; } cout << result; } |