Skip to content

Commit 30d769b

Browse files
authored
Create Lecture - 26.cpp
1 parent d1e3183 commit 30d769b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Lecture - 26.cpp

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// main.cpp
3+
// hsgts
4+
//
5+
// Created by Prince Kumar on 29/03/19.
6+
// Copyright © 2019 Prince Kumar. All rights reserved.
7+
// Chef and his daily routine Problem Code: CHEFROUT
8+
9+
#include <iostream>
10+
using namespace std;
11+
int main()
12+
{
13+
int T; cin>>T;
14+
while(T--)
15+
{
16+
string s; cin>>s;
17+
int count=0;
18+
for(int i=0;i<s.size()-1;i++)
19+
{
20+
if(s[i]=='C')
21+
{
22+
if(s[i+1]=='E' ||s[i+1]=='S' || s[i+1]=='C')
23+
count++;
24+
}
25+
else if(s[i]=='E')
26+
{
27+
if(s[i+1]=='S' || s[i+1]=='E')
28+
count++;
29+
}
30+
else if(s[i]=='S')
31+
{
32+
if(s[i+1]=='S')
33+
count++;
34+
}
35+
}
36+
if(count==s.size()-1)
37+
cout<<"yes"<<endl;
38+
else
39+
cout<<"no"<<endl;
40+
}
41+
}

0 commit comments

Comments
 (0)