#include <bits/stdc++.h>
using namespace std;
int n;
int lt;
string s;
bool t=0;
int w;
int main()
{
cin >> n;
cin >> s;
lt=n/10;
for(int j = 0 ; j < 10 ; j++)
{
t = 0;
for(int i = lt*j ; i < lt*(j+1) ; i++)
{
if(s[i]=='N')t = 1;
}
if(t==0)w++;
}
cout << w;
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 27 28 29 30 | #include <bits/stdc++.h> using namespace std; int n; int lt; string s; bool t=0; int w; int main() { cin >> n; cin >> s; lt=n/10; for(int j = 0 ; j < 10 ; j++) { t = 0; for(int i = lt*j ; i < lt*(j+1) ; i++) { if(s[i]=='N')t = 1; } if(t==0)w++; } cout << w; return 0; } |
English