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

×

Getting Wrong Answer please help


hello buddy.. tested your code . problem is in cin.ignore() line actually it is ignoring first of new test case's first ingredient.

example
if my string is cupcake it will take as upcake so remove the cin.ignore() fron inside the while and place it before while as we have to clear the instream only once for getline to work.

link

answered 03 Oct '17, 19:11

cody_algorith's gravatar image

2★cody_algorith
0
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:

×349

question asked: 03 Oct '17, 05:18

question was seen: 112 times

last updated: 03 Oct '17, 19:11