CodeChef Chef and his daily routine Solution – CodeChef CHEFROUT Solution
CodeChef Problem Link – https://www.codechef.com/problems/CHEFROUT
Problem Name: Chef and his daily routine Solution
Problem Code: CHEFROUT Chef and his daily routine Solution in C
Problem Number : CodeChef – Chef and his daily routine Solution,
Online Judge : CodeChef Online Judge Solution
Category: Beginner
Solution Language : C
CodeChef Solution Chef and his daily routine – CHEFROUT Code in C:
#include<stdio.h>
#include<string.h>
int main()
{
int N=100000,i,l,T;
char s[N];
scanf("%d",&T);
while(T>0)
{
int flag=0;
scanf("%s",s);
l=strlen(s);
for(i=0; i<l-1; i++)
{
if(((s[i]=='E')&&(s[i+1]=='C'))||((s[i]=='S')&&(s[i+1]=='E'))||((s[i]=='S')&&(s[i+1]=='C')))
{
flag=1;
printf("non");
break;
}
}
if(flag==0)
{
printf("yesn");
}
T--;
}
return 0;
}