Letters To Numbers
All submissions for this problem are available.
Ramu is trapped in the villains den in Badmanpur. Luckily for him it is an Indian villain who conveniently left a pencil and paper nearby. Ramu remembers his childhood days with the hero, Majnu, when they used code language. Their code was to change the English alphabet to numbers starting with X as 1 and ending with W as 26. So, X=1, Y=2, Z=3, A=4, B=5, etc. They would also separate words using semi-colons(";").
Ramu was able to send the coded letter to Majnu. Majnu needs to decipher the code to rescue Laila and Ramu.
Help Majnu decode Ramu's letter. Change the numbers into letters and letters into numbers. Remember, spaces were used to separate letters and semi-colons (not spaces) to separate words. There is no semi-colon after the last letter or number
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
- Each line consists of one or more words. For example the input file could be as follows, where the 1 indicates that there are one test case:
- For each test case, output a single line containing the equivalent words and numbers.
Should contain all the constraints on the input data that you may have. Format it like:
- 1 ≤ T ≤ 50
- Numbers should be translated into the equivalent letters followed by semi-colons
- Any other characters found, such as "-", "/", ".", ",", should be output exactly as they are.
- Code should not be case-sensitive.
Input: 2 Main road 2-7-1/2 Way Output: 16 4 12 17;21 18 4 7 B-D-A/B;26 4 2
Example case 1.M is 16, A is 4, I is 12 and N is 17 and hence Main translates to 16 4 12 17; where the semi-colon indicates the end of the word main (replaces the space between main and road)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.