Before seeing the Island of Elba, I was never a man, but the Island of Elba was never a man.
Description
You should have heard of replies? To put it simply, reading back is the same as reading back. In Chinese history, there have also been some poems, four of which are famous:
Spring Chunqing, spring, and moon. Moon and night, spring and spring, and spring. Summer Xianglian bishui, fengliang, and long summer. In the long summer, the wind is refreshing and the breeze is refreshing. Autumn Chu Yan Su Sha Zhou in the autumn River, and Yan Su shazhou Qian Shui. Shangsu geese in Shangzhou, and Chu jiangqiu. Winter The red furnace is transparent to the cold wind, and the cold wind is warm to the winter. Winter Longyu wind and cold charcoal, wind and cold charcoal transparent furnace red.
Let's have a visit today, "Chongyang, but not Mei ". For the moment, we do not consider Chinese Text-back, but English text-back. Simple English replies include aba and madam. Now we provide the definition of the Background: After filtering all non-letter characters (including spaces), the case of letters is not considered, words, phrases, or sentences that are the same from left to right and from right to left. The most famous return in English is said to have come from Comrade Napoleon: Able was I ere I saw Elba. It means that before seeing the Island of Elba, I was never a man. Note: here the ere is an ancient character, and sometimes someone else uses it, And before (in ...... Previously, Comrade Napoleon was evicted to Elba after the Russian war failed.
Input
The first behavior is an integer t, indicating that there are t groups of test data. Next there will be t rows, with one string per line. Each string must contain letters and characters.
Output
For each string, determine whether it is the input string we have defined. If Yes is output, otherwise No is output.
Sample Input
5abcMadamMadam, I’m adam.Golf, No Sir, prefer prison flog!Able was I ere I saw Elba.
Sample output
NoYesYesYesYes#include <iostream> #include <cmath> #include <cstring> using namespace std; const int a = 100; char str[a+1]; char t[a+1]; int main() { int j=0,n,i,len,f; cin >> n; cin.get(); while (n--) { char t[a+1]={0}; f=1; j=0; cin.getline(str,a+1); for (i=0;str[i]!='\0';i++) { if ( (str[i]>='a'&&str[i]<='z') ||(str[i]>='A'&&str[i]<='Z') ) { t[j]=str[i]; j++; } } /*for (i=0;t[i]!='\0';i++) { cout << t[i] << endl; } */ len=strlen(t); for (i=0;i<len/2;i++) { if ((t[i]!=t[len-1-i])&&abs(t[i]-t[len-1-i])!=32) { f=0; } } if (f==0) { cout << "No" << endl; } else { cout << "Yes" << endl; } } return 0; }