#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int t = n / 10; int res =0; while (n > 0) { bool dupa = true; for(int k = 0; k < t; k++) { char test; cin >> test; if (test == 'N') dupa = false; } n -= t; if (dupa) res++; } cout << res << '\n'; }
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; cin >> n; int t = n / 10; int res =0; while (n > 0) { bool dupa = true; for(int k = 0; k < t; k++) { char test; cin >> test; if (test == 'N') dupa = false; } n -= t; if (dupa) res++; } cout << res << '\n'; } |