#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
int n;
cin >> n;
int result = 0;
for (auto round = 0; round < 10; round++) {
bool success = true;
for (auto i = 0; i < n / 10; i++) {
char c;
cin >> c;
if (c == 'N') success = false;
}
if (success) result++;
}
cout << result << 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 | #include <iostream> using namespace std; int main(int argc, const char * argv[]) { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); int n; cin >> n; int result = 0; for (auto round = 0; round < 10; round++) { bool success = true; for (auto i = 0; i < n / 10; i++) { char c; cin >> c; if (c == 'N') success = false; } if (success) result++; } cout << result << endl; return 0; } |
English