#include <bits/stdc++.h>
using namespace std;
const int SIZE = 110;
char tests[SIZE];
int n;
int group;
int main() {
cin.tie(0); cout.tie(0); ios::sync_with_stdio(0);
cin>>n;
group = n/10;
int points = 0;
bool isOk = true;
for(int i=1; i<=n; i++) {
char a; cin>>a;
if(a == 'N') isOk = false;
if(i%group==0) {
if(isOk)
points++;
else isOk = true;
}
}
cout<<points;
}
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 | #include <bits/stdc++.h> using namespace std; const int SIZE = 110; char tests[SIZE]; int n; int group; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cin>>n; group = n/10; int points = 0; bool isOk = true; for(int i=1; i<=n; i++) { char a; cin>>a; if(a == 'N') isOk = false; if(i%group==0) { if(isOk) points++; else isOk = true; } } cout<<points; } |
English