#include <bits/stdc++.h>
using namespace std;
int n, t, odp;
int main() {
cin>>n;
t = n/10;
for (int i=0; i<n/t; i++)
{
int b = 1;
for (int j=0; j<t; j++)
{
char x;
cin>>x;
if(x=='N')
b--;
}
if (b==1)
odp++;
}
cout<<odp<<'\n';
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <bits/stdc++.h> using namespace std; int n, t, odp; int main() { cin>>n; t = n/10; for (int i=0; i<n/t; i++) { int b = 1; for (int j=0; j<t; j++) { char x; cin>>x; if(x=='N') b--; } if (b==1) odp++; } cout<<odp<<'\n'; } |
English