This is the code I made. Please tell the error in this code if any. The Problem code is “FANCY” available on CodeChef. When I submit the answer it comes out to be wrong. Please help me.
#include //Header Files Included
#include<string.h>
using namespace std;
main()
{
int t,chk; char s[100];
cin>>t;
while(t–)
{
chk=0;cin.ignore();
cin.getline(s,100);
for(int i=0;i<=strlen(s);i++)
{
if (s[i]==‘n’)
{
if(s[i+1]==‘o’&&s[i+2]==‘t’&&(s[i+3]==’ ‘||s[i+3]==’\0’))
{chk=1;goto l;}
}
}
l:
if(chk==1)
cout<<"\nReal Fancy\n";
else if(chk==0)
cout<<"\nregularly fancy\n";
}
}