You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caesar's Cipher is an old encryption tatic that is defined by shifting all letters of a string or substring to the right the same amount in order to disguise the message. E.g: if the cipher is 2, A becomes C, Z becomes B and so forth.
Input
The input will be comprised of many entries:
one int that will state how many scenarios will be tested -- lets call it n
n pairs of entries, in the following order
a string of shifted letters
an int stating the number of shifts or jumps (aka the cipher)
Each input is expected on it's own line (so no argv, use input reads)
Output
The restored string, with the cipher applied, one per line
Description
Caesar's Cipher is an old encryption tatic that is defined by shifting all letters of a string or substring to the right the same amount in order to disguise the message. E.g: if the cipher is 2, A becomes C, Z becomes B and so forth.
Input
The input will be comprised of many entries:
int
that will state how many scenarios will be tested -- lets call itn
n
pairs of entries, in the following orderstring
of shifted lettersint
stating the number of shifts or jumps (aka the cipher)Each input is expected on it's own line (so no
argv
, use input reads)Output
The restored string, with the cipher applied, one per line
Example
6
TOPCODER
VQREQFGT
QRSTUVWXYZABCDEFGHIJKLMNOP
ABCDEFGHIJKLMNOPQRSTUVWXYZ
TOPCODER
10
AXCHMA
TOPCODER
CAMOBAP
0
HELLOWORLD
ZWBGLZ
25
DBNPCBQ
1
LIPPSASVPH
4
Original problem
The text was updated successfully, but these errors were encountered: