#include <stdio.h>
int main(){
int n;
char str[1024];
scanf("%d %s", &n, str);
n /= 10;
int idx = 0;
int res = 0;
for(int i = 0; i < 10; ++i){
int f = 1;
for(int j = 0; j < n; ++j){
if (str[idx++] == 'N'){
f = 0;
}
}
res += f;
}
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 | #include <stdio.h> int main(){ int n; char str[1024]; scanf("%d %s", &n, str); n /= 10; int idx = 0; int res = 0; for(int i = 0; i < 10; ++i){ int f = 1; for(int j = 0; j < n; ++j){ if (str[idx++] == 'N'){ f = 0; } } res += f; } printf("%d\n", res); return 0; } |
English