#include <iostream>
using namespace std;
int main()
{
int n;
string s;
cin >> n >> s;
int po = 0;
for(int i = 0; i < 10; i++)
{
bool p = 1;
for(int j = i*(n/10); j < i*(n/10)+n/10; j++)
{
if(s[j] == 'N')
{
p=0;
break;
}
}
if(p)
po++;
}
cout << po;
}
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 | #include <iostream> using namespace std; int main() { int n; string s; cin >> n >> s; int po = 0; for(int i = 0; i < 10; i++) { bool p = 1; for(int j = i*(n/10); j < i*(n/10)+n/10; j++) { if(s[j] == 'N') { p=0; break; } } if(p) po++; } cout << po; } |
English