Problem Code: TEST c++

i tried Problem Code: TEST. i compiled in your editor and got the expected result. but when i submitted the same, it said “wrong answer”. What was the reason.

I need the C++ possible answers of Problem Code: TEST; just for understanding purpose.

Or any other code/ link; to be ABLE to SUBMIT MY ANSWER CORRECTLY.

#HERE is my accepted solution…