// 2019 IUSB Programming Competition // Round 1 Problem 2 // Check if a string is a palindrome // Solution by Liguo Yu #include #include using namespace std; int main() { bool yes = true; string word; getline(cin, word); for(int i = 0; i < word.length(); i++) word[i] = tolower(word[i]); int size = 0; for(int i = 0; i < word.length(); i++) { if ((int)word[i] >= 97 && (int)word[i] <= 122) { size ++; } } int * a = new int[size]; int j = 0; for(int i = 0; i < word.length(); i++) { if ((int)word[i] >= 97 && (int)word[i] <= 122) { a[j] =word[i]; j = j+ 1; } } for(int i = size - 1; i >= 0; i--) { if (a[i] != a[size - i - 1]) { yes = false; } } if(yes == true) cout << "yes"; else cout << "no"; return 0; }