#include<iostream>
using namespace std;
string c;
int main(){
int n; cin >> n;
cin >> c;
int rund=n/10;
int test;
int wynik=0;
for(int i=0; i<10; i++){
test =1;
for(int j=0; j<rund; j++){
if(c[rund*i+j]=='N'){
test=0;
}
}
wynik+=test;
}
cout << wynik;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include<iostream> using namespace std; string c; int main(){ int n; cin >> n; cin >> c; int rund=n/10; int test; int wynik=0; for(int i=0; i<10; i++){ test =1; for(int j=0; j<rund; j++){ if(c[rund*i+j]=='N'){ test=0; } } wynik+=test; } cout << wynik; } |
English