#include <cstdio> int main() { int n, r = 0, g = 0; scanf("%i ", &n); for (int i = 0; i<n; i++) { if (i%(n/10) == 0) g = 1; if (getchar() != 'T') g = 0; if ((i+1)%(n/10) == 0) r += g; } printf("%i\n", r); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <cstdio> int main() { int n, r = 0, g = 0; scanf("%i ", &n); for (int i = 0; i<n; i++) { if (i%(n/10) == 0) g = 1; if (getchar() != 'T') g = 0; if ((i+1)%(n/10) == 0) r += g; } printf("%i\n", r); return 0; } |