-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChat room.cpp
More file actions
58 lines (57 loc) · 1.66 KB
/
Chat room.cpp
File metadata and controls
58 lines (57 loc) · 1.66 KB
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
49
50
51
52
53
54
55
56
57
58
#include<bits/stdc++.h>
using namespace std;
int main()
{
string str;
cin >> str;
int len = str.length();
if(len<5)
{
cout << "NO" << endl;
return 0;
}
for(int i=0;i<len;i++)
{
if(str[i]=='h')
{
for(int j=i+1;j<len;j++)
{
if(str[j]=='e')
{
for(int k=j+1;k<len;k++)
{
if(str[k]=='l')
{
for(int l=k+1;l<len;l++)
{
if(str[l]=='l')
{
for(int m=l+1;m<len;m++)
{
if(str[m]=='o')
{
cout << "YES" << endl;
return 0;
}
else if(m==len-1)
break;
}
}
else if(l==len-1)
break;
}
}
else if(k==len-1)
break;
}
}
else if(j==len-1)
break;
}
}
else if(i==len-1)
break;
}
cout << "NO" << endl;
return 0;
}