📅  最后修改于: 2022-03-11 14:44:57.993000             🧑  作者: Mango
// Check whether the string is a palindrome or not.
#include
using namespace std;
int main(){
string s;
cin >> s;
int l = 0;
int h = s.length()-1;
while(h > l){
if(s[l++] != s[h--]){
cout << "Not a palindrome" << endl;
return 0;
}
}
cout << "Is a palindrome" << endl;
return 0;
}