Getting Wrong Answer please help

Problem link-SIMDISH Problem - CodeChef
My solution link-CodeChef: Practical coding for everyone

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.