-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path1218.cpp
More file actions
44 lines (42 loc) · 743 Bytes
/
1218.cpp
File metadata and controls
44 lines (42 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<bits/stdc++.h>
using namespace std;
int main()
{
string n;
int m=0;
bool prim=false;
while(cin >>n)
{
if(prim==true)
{
printf("\n");
}
char s[1000000];
scanf(" %[^\n]",s);
int f=0,ma=0,ans=0;
char *p=strtok(s," ");
vector<string>af;
while(p!=0)
{
char q[100000];
sscanf(p," %s",q);
p=strtok(NULL," ");
af.push_back(q);
}
for(int i=0;i<af.size();i++)
{
if(af[i]==n)
{
ans++;
if(af[i+1]=="F")f++;
else ma++;
}
}
printf("Caso %d:\n",++m);
printf("Pares Iguais: %d\n",ans);
printf("F: %d\n",f);
printf("M: %d\n",ma);
prim=true;
}
return 0;
}