Page 1 of 1

PostPosted: Sat Mar 15, 2003 1:23 am
by Johnny
here is a c sample
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

int main(void) {
char c, offset;
while ((c = getchar()) != EOF) {
if (isalpha(c)) {
offset = isupper(c) ? 'A' : 'a';
putchar(offset + ((c - offset + 13) % 26));
} else {
putchar(c);
}
}
return EXIT_SUCCESS;
}