UVA 401 - Palindromes

Problem PDF

Solution:

/*-----------------------------------------------*/
//Problem Name  : Palindromes
//Uva Problem No: 401
//Type          : Ad hoc, Strings, Palindromes.
//Author        : Shipu Ahamed
//University    : BUBT
//E-mail        : shipuahamed01@gmail.com
/*-----------------------------------------------*/

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll long long
#define sc scanf
#define pf printf
#define pi 2*acos(0.0)
using namespace std;
int main()
{
 string s,a,b;
 char m[3000];

 memset(m,NULL,sizeof(m));
 m['A']='A';
 m['E']='3';
 m['H']='H';
 m['I']='I';
 m['J']='L';
 m['L']='J';
 m['M']='M';
 m['O']='O';
 m['S']='2';
 m['T']='T';
 m['U']='U';
 m['V']='V';
 m['W']='W';
 m['X']='X';
 m['Y']='Y';
 m['Z']='5';
 m['1']='1';
 m['2']='S';
 m['3']='E';
 m['5']='Z';
 m['8']='8';
 while(cin>>s){
  a=b="";
  int len=s.size();
  for(int i=len-1;i>=0;i--)
  {
      a+=s[i];
      b+=m[s[i]];
  }
 // cout<
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/401/401.cpp