Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define r(x, ns) for(auto& x : ns)
- int main() {
- int ct = 0;
- string n, p;
- while(cin>>n) {
- if(ct) cout<<'\n';
- int x, m = 0, f = 0;
- getline(cin, p), getline(cin, p);
- string sum = "";
- r(l, p) {
- if(l == 'M' || l == 'F') {
- if (sum == n) (l == 'M' ? ++m : ++f);
- sum = "";
- }
- else if(l != ' ') sum += l;
- }
- printf("Caso %d:\nPares Iguais: %d\nF: %d\nM: %d\n", ++ct, m + f, f, m);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement