I can't figure out why am i getting WA....I have tested it with lot of test cases & its working fine for me.Please help me out.here's my code...
removed ;)
Fflush(stdin) has undefined behaviour. Gets will remove the EOL characters for you. I suggest using getline instead though.