#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string wczytane_testy;
cin >> wczytane_testy;
int liczba_punktow = 0, liczba_testow = n / 10, dl_wynikow = wczytane_testy.length(),pom = 0;
for (int i = 0; i < dl_wynikow; i += liczba_testow) {
pom = 0;
for (int j = 0; j < liczba_testow; j++) {
if (wczytane_testy[i + j] == 'T') {
pom++;
}
}
if(pom == liczba_testow ){
liczba_punktow++;
}
}
cout << liczba_punktow << endl;
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 | #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string wczytane_testy; cin >> wczytane_testy; int liczba_punktow = 0, liczba_testow = n / 10, dl_wynikow = wczytane_testy.length(),pom = 0; for (int i = 0; i < dl_wynikow; i += liczba_testow) { pom = 0; for (int j = 0; j < liczba_testow; j++) { if (wczytane_testy[i + j] == 'T') { pom++; } } if(pom == liczba_testow ){ liczba_punktow++; } } cout << liczba_punktow << endl; return 0; } |
English