#include<cstdio> char c[200]; int main(){ int n; scanf("%d%s", &n, c); int s = 0; for (int i = 0; i < 10; i++) { int all = 1; for (int j = 0; j < n / 10; j++) { all &= c[i * n / 10 + j] == 'T'; } s += all; } printf("%d\n", s); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include<cstdio> char c[200]; int main(){ int n; scanf("%d%s", &n, c); int s = 0; for (int i = 0; i < 10; i++) { int all = 1; for (int j = 0; j < n / 10; j++) { all &= c[i * n / 10 + j] == 'T'; } s += all; } printf("%d\n", s); return 0; } |