Test cases failed

it is giving me the right answer but all test cases failed.

I have edited your code… Only endl was missing after every test case… Rest everything was fine with the code… Refer to it …