#include <cstdio>
int testow;
char test[105];
int punkty = 0;
int main(){
scanf(" %d %s",&testow,&test);
for(int i=0; i<testow; i++){
int poprawnych = 0;
int grupa = testow/10;
for(int j=0; j< grupa; j++){
if(test[i*grupa+j]=='T')
poprawnych++;
}
if(poprawnych == grupa)
punkty++;
}
printf("%d",punkty);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <cstdio> int testow; char test[105]; int punkty = 0; int main(){ scanf(" %d %s",&testow,&test); for(int i=0; i<testow; i++){ int poprawnych = 0; int grupa = testow/10; for(int j=0; j< grupa; j++){ if(test[i*grupa+j]=='T') poprawnych++; } if(poprawnych == grupa) punkty++; } printf("%d",punkty); return 0; } |
English