#include <bits/stdc++.h>
#define LL long long
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<n;i++)
#define REV(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define pri(a) cout<<a<<endl
#define prii(a,b) cout<<a<<" "<<b<<endl
#define hi printf("Hello World\n")
#define WRITE(fn) freopen(fn, "w", stdout);
#define pcs printf("Scenario #%d:\n", ++cs);
using namespace std;
int main()
{
string s,tst;
map<char,char> mp;
mp['A'] = 'A';
mp['E'] = '3';
mp['H'] = 'H';
mp['I'] = 'I';
mp['J'] = 'L';
mp['L'] = 'J';
mp['M'] = 'M';
mp['O'] = 'O';
mp['S'] = '2';
mp['T'] = 'T';
mp['U'] = 'U';
mp['V'] = 'V';
mp['W'] = 'W';
mp['X'] = 'X';
mp['Y'] = 'Y';
mp['Z'] = '5';
mp['1'] = '1';
mp['2'] = 'S';
mp['3'] = 'E';
mp['5'] = 'Z';
mp['8'] = '8';
while(cin>>s)
{
int p = 0, m = 0;
tst = s;
reverse(ALL(tst));
if(tst == s) p = 1;
tst = "";
REP(i,SZ(s))
{
tst += mp[s[i]];
}
reverse(ALL(tst));
if(s == tst) m = 1;
if(p and m) cout << s , printf(" -- is a mirrored palindrome.\n");
else if(m and !p) cout << s , printf(" -- is a mirrored string.\n");
else if(!m and p) cout << s , printf(" -- is a regular palindrome.\n");
else if(!m and !p) cout << s , printf(" -- is not a palindrome.\n");
cout << "\n";
}
return 0;
}
No comments:
Post a Comment