UVa 444 - Encoder and Decoder

444 - Encoder and Decoder

 * http://acm.uva.es/p/v4/444.html

Summary
We need to determine whether or not a string is encoded by the first character. If its a number then its encoded or else its decoded and you have to do the opposite operation.

Explanation

 * To encode a message append the values of each character to a string and reverse it.
 * To decode a message reverse the string and convert the value of a given character into a character.

Gotchas

 * When parsing the encoded message be sure to test your lowercase test cases well.

Input
abc 798999 Have a Nice Day ! 001

Output
998979 cba 332312179862310199501872379231018117927 d