Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string word;
- cin >> word;
- bool palindrom = false;
- for (int i = 0, j = word.size() - 1; i < j; i++, j--) {
- if (word[i] != word[j]) {
- palindrom = false;
- break;
- }
- else {
- palindrom = true;
- }
- }
- if (palindrom == false) { cout << "ne"; }
- else { cout << "da"; }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement