#include<cstdio>
#include<algorithm>
using namespace std;
int n;
char tests[150];
int main()
{
scanf("%d %s", &n, tests);
int k=n/10;
int cur=0;
int res=0;
for(int i=0;i<10;i++) {
cur = 1;
for(int j=0;j<k;j++) {
if(tests[i*k+j]=='N') {
cur=0;
}
}
res+=cur;
}
printf("%d\n", res);
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 25 26 | #include<cstdio> #include<algorithm> using namespace std; int n; char tests[150]; int main() { scanf("%d %s", &n, tests); int k=n/10; int cur=0; int res=0; for(int i=0;i<10;i++) { cur = 1; for(int j=0;j<k;j++) { if(tests[i*k+j]=='N') { cur=0; } } res+=cur; } printf("%d\n", res); return 0; } |
English