-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCHEFCHR.cpp
More file actions
35 lines (34 loc) · 802 Bytes
/
CHEFCHR.cpp
File metadata and controls
35 lines (34 loc) · 802 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
long int t;
cin>>t;
while(t--)
{
string s;
cin>>s;
map<char,int> m;
m.insert(pair<char,int>('c',5));
m.insert(pair<char,int>('e',7));
m.insert(pair<char,int>('f',13));
m.insert(pair<char,int>('h',17));
long int len=s.length();
long int ans=0;
int cnt=0;
for(long int i=0;i<=len-4;i++)
{
if(s[i]=='c'||s[i]=='h'||s[i]=='e'||s[i]=='f')
{
cnt+=(m[s[i]]+m[s[i+1]]+m[s[i+2]]+m[s[i+3]]);
if(cnt==42)
ans++;
cnt=0;
}
}
if(ans)
cout<<"lovely "<<ans<<endl;
else
cout<<"normal"<<endl;
}
}