#include <bits/stdc++.h>
using namespace std;
int main(void){
uint64_t n;
cin>>n;
string s;
cin>>s;
uint64_t pakiet = n/10, ile = 0;
bool git;
for(int i=0; i < n;i+=pakiet){
git = true;
for(int j=0;j < pakiet; j++){
if(s[i+j] != 'T'){
git = false;
break;
}
}
if(git){
ile++;
}
}
cout<<ile<<"\n";
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 | #include <bits/stdc++.h> using namespace std; int main(void){ uint64_t n; cin>>n; string s; cin>>s; uint64_t pakiet = n/10, ile = 0; bool git; for(int i=0; i < n;i+=pakiet){ git = true; for(int j=0;j < pakiet; j++){ if(s[i+j] != 'T'){ git = false; break; } } if(git){ ile++; } } cout<<ile<<"\n"; return 0; } |
English