-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCHEFROUT.cpp
More file actions
50 lines (43 loc) · 985 Bytes
/
CHEFROUT.cpp
File metadata and controls
50 lines (43 loc) · 985 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
49
#include <iostream>
using namespace std;
int main() {
// your code goes here
int T;
cin>>T;
while(T--){
string s;
cin>>s;
int len = s.length();
//cout<<len<<endl;
int count =0;
for(int i=0;i<len-1;i++){
if(s[i]=='C'){
if((s[i+1]=='E')||(s[i+1]=='C')||(s[i+1]=='S')){
count++;
}
}
else if(s[i]=='E'){
if((s[i+1]=='E')||(s[i+1]=='S')){
count++;
}
else if(s[i+1=='C']){
cout<<"no"<<endl;
break;
}
}
else if(s[i]=='S'){
if((s[i+1]=='C')||(s[i+1]=='E')){
cout<<"no"<<endl;
break;
}
else if(s[i]=='S'){
count++;
}
}
}
if(count==len-1){
cout<<"yes"<<endl;
}
}
return 0;
}