Fancy quotes giving wrong answer (FANCY)

I dont know in which case its failing

#include<iostream>
#include<cstdio>
#include<cstring>
// for <streamsize> 
#include<ios>      
  
// for numeric_limits 
#include<limits>  
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);


using namespace std;

int main()
{
	FAST_IO

int T;

cin>>T;
while(T--)
{
	int flag=0,k;	 
    
	char S[100];
    
	scanf("\n");
    scanf("%[^\n]%*c",S);
    
	for(k=0;S[k]!='\0';k++);

//cout<<k<<endl;

	for(int i=0;i<k;i++)
	{
		if((S[i]=='n' && i==0)||(S[i]=='n' && S[i-1]==' '))
		{	
			
			if(S[i+1] == 'o')
			{
				if(S[i+2]== 't')
				{
					if(S[i+3] == ' ' || S[i+3] == '\0' )
							{
								flag=1;
							//	break;
							}
				}
			}
		}


	}
	


if(flag == 1)
	cout<<"Real Fancy"<<"\n";
else
	cout<<"regularly fancy"<<"\n";

 
}

    return 0;
}


I don’t either, so why don’t YOU debug YOUR code?

i have already did debugging on this code. but iam not getting where am going wrong .any how i solved this problem .

If you solve a Problem that you’ve asked for help for, please edit your post so that people don’t waste time solving the issue for you.

2 Likes