找回文数和镜像;
#include<iostream>
#include<string>
using namespace std;
int main ()
{
string line;
string line1;
string line3;
int k;
while(cin>>line1)
{
line3=line1;
int n=line1.size();
int high=n-1;
int low=0;
int flag1=0;
int flag2=0;
int j;
for(k=0;k<n;k++)
if(line1[k]=='0')
line1[k]='O';
line=line1;
for(;high>low;high--,low++)
{
if(line1[high]!=line1[low])
{flag1=1;break;}
}
for(j=0;j<n;j++)
{
if(line[j]=='E'){line[j]='3';continue;}
if(line[j]=='3'){line[j]='E';continue;}
if(line[j]=='J'){line[j]='L';continue;}
if(line[j]=='L'){line[j]='J';continue;}
if(line[j]=='S'){line[j]='2';continue;}
if(line[j]=='2'){line[j]='S';continue;}
if(line[j]=='Z'){line[j]='5';continue;}
if(line[j]=='5'){line[j]='Z';continue;}
}
for(high=n-1,low=0;high>=0;high--,low++)
{
if(line[high]!='E'&&line[high]!='3'&&line[high]!='J'&&line[high]!='L'&&line[high]!='S'&&line[high]!='2'&&line[high]!='Z'&&line[high]!='5'&&line[high]!='A'&&line[high]!='H'&&line[high]!='I'&&line[high]!='M'&&line[high]!='O'&&line[high]!='0'&&line[high]!='T'&&line[high]!='V'&&line[high]!='U'&&line[high]!='W'&&line[high]!='X'&&line[high]!='Y'&&line[high]!='8')
{flag2=1;break;}
if(line[high]!=line1[low])
{flag2=1;break;}
}
if(flag1==1&&flag2==1)
cout<<line3<<" -- is not a palindrome."<<endl<<endl;
if(flag1==1&&flag2==0)
cout<<line3<<" -- is a mirrored string."<<endl<<endl;
if(flag1==0&&flag2==0)
cout<<line3<<" -- is a mirrored palindrome."<<endl<<endl;
if(flag1==0&&flag2==1)
cout<<line3<<" -- is a regular palindrome."<<endl<<endl;
}
return 0;
}