#include<iostream>
#include<string>
using namespace std;
int main(){
int n;
string s;
cin>>n;
cin>>s;
int pkt=0;
int k=n/10;
int wsk=0;
for(int i=0;i<10;i++){
bool ok=true;
for(int j=0;j<k;j++){
if(s[wsk]=='N') ok=false;
wsk++;
}
if(ok) pkt++;
}
cout<<pkt;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<iostream> #include<string> using namespace std; int main(){ int n; string s; cin>>n; cin>>s; int pkt=0; int k=n/10; int wsk=0; for(int i=0;i<10;i++){ bool ok=true; for(int j=0;j<k;j++){ if(s[wsk]=='N') ok=false; wsk++; } if(ok) pkt++; } cout<<pkt; } |
English