-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrieza.cpp
More file actions
48 lines (46 loc) · 910 Bytes
/
frieza.cpp
File metadata and controls
48 lines (46 loc) · 910 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
45
46
47
48
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
string s;
cin>>s;
int l=s.length();
int a[100000]={0};
for(int i=0;i<l;i++)
{
if(s[i]=='f'||s[i]=='r'||s[i]=='i'||s[i]=='e'||s[i]=='z'||s[i]=='a')
{
a[i]=1;
}
else
a[i]=-1;
}
for(int i=0;i<l;i++)
{
int c=1;
while(i<=l)
{
if(a[i]==a[i+1])
{
c++;
i++;
}
else
{
printf("%d",c);
break;
}
}
}
/*for(int i=0;i<l;i++)
{
cout<<a[i]<<" ";
}*/
printf("\n");
}
return 0;
}