|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||28||25||25||92.593%|
A Caesar cipher is a way of encrypting text. Each letter in the text is replaced by the letter s places after it in the alphabet. S is called the shift – with a shift of 5, for example, 'A' becomes 'F', 'H' becomes 'M' and 'Y' becomes 'D '(the alphabet wraps round so 'A' follows 'Z'). The text is easy to decrypt if you know the value of s.
Cedric has come up with a variation on this. Instead of telling his friends what the shift is, he encrypts the letter 'A' (always producing an upper case letter) and places it at the end of his message. In that way, they can work out what the shift is and thus decrypt the text.
Input will consist of a number of lines of text, terminated by a line consisting of only #. Each line will consist of up to 255 characters of encrypted text (including the encrypted 'A').
Output will be one line for each line of input containing the decrypted text. The final letter 'A' should NOT be included. Punctuation, spaces, digits and any other non-letter characters are output unchanged.
N hfs wjfi ymnx xjsyjshj, xt rd fqltwnymr btwpx.F Serq Unzvygba-Wbarf vf 85 gbqnl! Unccl oveguqnl, Serq.N Ocz lpdxf, wmjri ajs ephkzy jqzm ocz gvut yjbn.V #
I can read this sentence, so my algorithm works. Fred Hamilton-Jones is 85 today! Happy birthday, Fred. The quick, brown fox jumped over the lazy dogs.