+ 3
Bug in Code Coach, Palindrome Numbers (C++) [SOLVED]
My program is giving expected outputs but still it is showing incorrect.
6 Réponses
+ 5
The simple explanation is that you print a dot at the end, which you are not supposed to do.
+ 6
Can you share your code here ?
+ 4
We can't help for bugs mail to info@sololearn.com
+ 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;
}
+ 2
It is Quite Sensitive.
Got it , thanks for help.
+ 1
Test Case 1 : -
Input :- 8888
Expected output : - 8888 is a palindrome
My output: - 8888 is a palindrome
But still it is showing incorrect