Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string s;
- cin >> s;
- int i = 0;
- int j = s.size() - 1;
- while(i < j) {
- if(s[i] == s[j]) {
- i++;
- j--;
- }
- else {
- cout << "NE E PALINDROM" << endl;
- return 0;
- }
- }
- cout << "PALINDROM" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement