Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <cstring>
- using namespace std;
- //Code utile
- bool checkPalin(const string& str)
- {
- size_t begin=0, end=str.size()-1;
- while(begin < end)
- {
- if(str[begin] != str[end])
- return false;
- begin++;
- end--;
- }
- return true;
- }
- //Fin code utile
- int main(void)
- {
- string rawtitle, title;
- getline(cin, rawtitle);
- //Debut code utile
- for(size_t pos=0; pos < rawtitle.size(); pos++)
- if(rawtitle[pos] != ' ')
- title.push_back(tolower(rawtitle[pos]));
- //Fin code utile
- if(checkPalin(title))
- cout << "1\n";
- else
- cout << "0\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement