Posted: Mon Jun 22, 2015 5:48 am
ABCDEFGHIJKLMNOPQRSTUVWXYZ
RSTUVWXYZABCDEFGHIJKLMNOPQ
C solution:
RSTUVWXYZABCDEFGHIJKLMNOPQ
C solution:
Code: Select all
#include <stdio.h>
#include <string.h>
int main() {
char input[200] = "cqrb lryqna rb fjh, fjh qjamna cqjw axc cqracnnw. qnan, hxd wnena twxf qxf oja cx bqroc! xq kh cqn fjh, cqn jwbfna rb mnjmvjwblqnbc.";
int i, len;
len = strlen(input);
for (i=0; i<len; i++) {
if (input[i] == 0x20 || input[i] == 0x21 || input[i] == 0x2c || input[i] == 0x2e) continue;
else if (input[i] <= 'i') input[i] += 17;
else input[i] -= 9;
}
printf("%s\n", input);
return 0;
}