+ 3

Bug in Code Coach, Palindrome Numbers (C++) [SOLVED]

My program is giving expected outputs but still it is showing incorrect.

21st Dec 2020, 10:53 AM
Nikunj Vashishtha
Nikunj Vashishtha - avatar
6 ответов
+ 5
The simple explanation is that you print a dot at the end, which you are not supposed to do.
21st Dec 2020, 1:22 PM
Shadow
Shadow - avatar
+ 6
Can you share your code here ?
21st Dec 2020, 11:02 AM
Arsenic
Arsenic - avatar
+ 4
We can't help for bugs mail to info@sololearn.com
21st Dec 2020, 10:59 AM
Aastha
Aastha - avatar
+ 3
Yes Sure , #include <iostream> #include <math.h> #include <algorithm> using namespace std; int main() { string str ; cin>>str; const string new_str = str; reverse(str.begin(), str.end()); if (new_str == str) { cout<<new_str<<" is a palindrome."; return true; } else { cout<<new_str<<" is NOT a palindrome."; return false; } return 0; }
21st Dec 2020, 1:19 PM
Nikunj Vashishtha
Nikunj Vashishtha - avatar
+ 2
It is Quite Sensitive. Got it , thanks for help.
21st Dec 2020, 1:27 PM
Nikunj Vashishtha
Nikunj Vashishtha - avatar
+ 1
Test Case 1 : - Input :- 8888 Expected output : - 8888 is a palindrome My output: - 8888 is a palindrome But still it is showing incorrect
21st Dec 2020, 1:21 PM
Nikunj Vashishtha
Nikunj Vashishtha - avatar