-
Notifications
You must be signed in to change notification settings - Fork 64
/
Lecture - 26.cpp
41 lines (40 loc) · 895 Bytes
/
Lecture - 26.cpp
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
//
// main.cpp
// hsgts
//
// Created by Prince Kumar on 29/03/19.
// Copyright © 2019 Prince Kumar. All rights reserved.
// Chef and his daily routine Problem Code: CHEFROUT
#include <iostream>
using namespace std;
int main()
{
int T; cin>>T;
while(T--)
{
string s; cin>>s;
int count=0;
for(int i=0;i<s.size()-1;i++)
{
if(s[i]=='C')
{
if(s[i+1]=='E' ||s[i+1]=='S' || s[i+1]=='C')
count++;
}
else if(s[i]=='E')
{
if(s[i+1]=='S' || s[i+1]=='E')
count++;
}
else if(s[i]=='S')
{
if(s[i+1]=='S')
count++;
}
}
if(count==s.size()-1)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
}