You are not logged in. Please login at www.codechef.com to post your questions!

×

Problem in JAN19 challenge solution

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<iostream> //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";
}

}

asked 11 Jan, 19:05

goelm's gravatar image

2★goelm
-11
accept rate: 0%

edited 11 Jan, 19:07


The discussion of problems from live contest is not allowed. Please wait till the contest gets over.

link

answered 11 Jan, 19:11

akash19jain's gravatar image

3★akash19jain
465
accept rate: 10%

@goelm kindly delete this post. It's against the CodeChef code of conduct to ask such questions during live contest.

This might ban you.

link

answered 11 Jan, 19:25

arjitkansal's gravatar image

5★arjitkansal
1078
accept rate: 0%

@admin @vijju123 please delete this post

link

answered 11 Jan, 20:47

admin4's gravatar image

3★admin4
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×374

question asked: 11 Jan, 19:05

question was seen: 389 times

last updated: 11 Jan, 20:47