/**** * caesar.c - Caesar Cipher * * - dementted ****/ /* The alphabet starting on 'd', lower and uppercase seperate */ char *s_alpha_lower = "defghijklmnopqrstuvwxyzabc"; char *s_alpha_upper = "DEFGHIJKLMNOPQRSTUVWXYZABC"; int main() { int c; while ((c = getchar()) != EOF) { if (isalpha(c)) { if (islower(c)) { c -= 0x60; c = (int) s_alpha_lower[c]; } else { c -= 0x40; c = (int) s_alpha_upper[c]; } } putchar(c); } return 0; }