January long challenge 1st problem have solved it in own my ide need AC from codechef

please help if you have thought if using string stream >> << these two opeartors then please do let me also know in a layman’s language or the simplest way to to make understand thanks in advance

#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int i=0,flag=0;
string v;
cin.ignore(1, ‘\n’);
getline(cin,v);
char a;
int n=v.length();

   while(v[i]!='\0')
  {
      
    
      if(v[i]=='n')
      {
          
      for(int j=0; j<n; j++)
      {
          if( v[i+1]=='o' &&v[i+2]=='t')
          {
              
            if((isspace(v[i+3]) && isspace(v[i-1])) || (v[i+3]=='\n' && isspace(v[i-1])))
            {
                flag=1;
                break;
            }
          }
      }
      }
      i++;
  }
  if(flag)
  cout<<"Real Fancy\n";
  else cout<<"regularly fancy\n";
}
	return 0; 
}

what if n is first letter itself??
then v[i-1] doesnt make any sense
just handle that case separately

this is not from the current long

4 Likes

Your code isn’t formatted properly. Refer this