Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- bool isPal(string str)
- {
- int count[256] = { 0 };
- for (int i = 0; str[i]; i++)
- count[str[i]]++;
- int odd = 0;
- for (int i = 0; i < 256; i++)
- {
- if (count[i] & 1)
- odd++;
- if (odd > 1)
- return false;
- }
- return true;
- }
- int main() {
- string str;
- cin >> str;
- if (isPal(str))
- cout << "ZA WARUDO TOKI WO TOMARE" << endl;
- else
- cout << "JOJO" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement