#include <iostream> int main() { unsigned int n; unsigned int batch_size; char c; unsigned int test_passed{0}; bool passed; std::cin >> n; batch_size = n/10; for (size_t i = 0; i < 10; i++) { passed = true; for (size_t j = 0; j < batch_size; j++) { std::cin >> c; if (c == 'N') { passed = false; } } test_passed += passed; } std::cout << test_passed << std::endl; return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <iostream> int main() { unsigned int n; unsigned int batch_size; char c; unsigned int test_passed{0}; bool passed; std::cin >> n; batch_size = n/10; for (size_t i = 0; i < 10; i++) { passed = true; for (size_t j = 0; j < batch_size; j++) { std::cin >> c; if (c == 'N') { passed = false; } } test_passed += passed; } std::cout << test_passed << std::endl; return 0; } |