1. Erste Version: C, Evgeni Pavlidis


/**
* ACM programming Contest WS 08/09
* UVa Status: accepted
* Run Time: 0.000
* @author Evgeni Pavlidis evgenipavlidis@yahoo.de
*/
#include <stdio.h>
#include <string.h>

int map[35];


void initMap(void)
{
map[0] = 'A';
map[4] = '3';
map[7] = 'H';
map[8] = 'I';
map[9] = 'L';
map[11] = 'J';
map[12] = 'M';
map[14] = 'O';
map[18] = '2';
map[19] = 'T';
map[20] = 'U';
map[21] = 'V';
map[22] = '2';
map[23] = 'X';
map[24] = 'Y';
map[25] = '5';
map[26] = '1';
map[27] = 'S';
map[28] = 'E';

map[30] = 'Z';


map[33] = '8';

}

int main()
{
initMap();

char string[30];
char message[80];
int length;

do
{
scanf("%s\n", string);

if(isMirrored(string))
if(isPalindrom(string))
printf("%s -- is a mirrored palindrome.\n",string);
else
printf("%s -- is a mirrored string.\n");
else
if(isPalindrom(string))
printf( "%s -- is a regular palindrome.\n");
else
printf("%s -- is not a palindrome.\n");

printf("\n");
}while(!feof(stdin));

return 0;
}
char reverse(char c)
{
if(c > 64)
return map[c-65];
else
return map[c -23];
}

int isPalindrom(char s[])
{
int length = strlen(s);
int i;

for(i = 0; i < length/2+1; i++)
if(s[i] != s[length - i - 1])
return 0;

return 1;
}


int isMirrored(char s[])
{
int length = strlen(s);
int i;

for(i = 0; i < length/2+1; i++)
if(s[i] != reverse(s[length - i - 1]))
return 0;

return 1;

}