#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, answer = 0; string str; cin >> n >> str; n /= 10; for(int i = 0; i < 10; ++i) { for(int j = 0; j < n; ++j) if(str[i*n + j] == 'N') goto I_HATE_GOTO; ++answer; I_HATE_GOTO:; } cout << answer; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, answer = 0; string str; cin >> n >> str; n /= 10; for(int i = 0; i < 10; ++i) { for(int j = 0; j < n; ++j) if(str[i*n + j] == 'N') goto I_HATE_GOTO; ++answer; I_HATE_GOTO:; } cout << answer; } |