// C1 - Liczenie punktow #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(0); int n; char c; bool isOk; int pts; pts = 0 ; cin >> n; for (int i = 0; i < n; ++i) { if (i % (n / 10) == 0) { isOk = true; } cin >> c; if (c == 'N') { isOk = false; } if ((i % (n / 10) == n / 10 - 1) && isOk) { ++pts; } } cout << pts << 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 24 25 26 27 28 29 30 31 32 | // C1 - Liczenie punktow #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(0); int n; char c; bool isOk; int pts; pts = 0 ; cin >> n; for (int i = 0; i < n; ++i) { if (i % (n / 10) == 0) { isOk = true; } cin >> c; if (c == 'N') { isOk = false; } if ((i % (n / 10) == n / 10 - 1) && isOk) { ++pts; } } cout << pts << endl; return 0; } |