#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; char a; int wyn = 0, pom, m = n/10; for (int i = 0; i < 10; ++i){ pom = 0; for (int j = 1; j <= m; ++j){ cin >> a; if (a == 'T') ++pom; } if (pom == m) ++wyn; } cout << wyn; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; char a; int wyn = 0, pom, m = n/10; for (int i = 0; i < 10; ++i){ pom = 0; for (int j = 1; j <= m; ++j){ cin >> a; if (a == 'T') ++pom; } if (pom == m) ++wyn; } cout << wyn; } |