-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatRoom.cpp
More file actions
44 lines (43 loc) · 1.16 KB
/
chatRoom.cpp
File metadata and controls
44 lines (43 loc) · 1.16 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
#include<iostream>
using namespace std;
int main()
{
char str[101];
cin>>str;
char* ptr = str;
int flag = 0;
while(*ptr != '\0'){
if(*ptr == 'h'){
ptr++;
while(*ptr!='\0'){
if(*ptr == 'e'){
ptr++;
while(*ptr != '\0'){
if(*ptr == 'l'){
ptr++;
while(*ptr !='\0'){
if(*ptr == 'l'){
ptr++;
while(*ptr != '\0'){
if(*ptr == 'o'){
flag = 1;
break;
}
else ptr++;
}
}
else ptr++;
}
}
else ptr++;
}
}
else ptr++;
}
}
else ptr++;
}
if(flag == 1) cout<<"YES";
else if (flag == 0) cout<<"NO";
return 0;
}