user
info

rot13.c

A very simple implementation of ROT13. Last modified Mar 31, 2001.

#include <stdio.h> int main() { char c; while ((c = getchar()) != EOF) { if (c >= 'a' && c <= 'z') c = (((c - 'a') + 13) % 26) + 'a'; else if (c >= 'A' && c <= 'Z') c = (((c - 'A') + 13) % 26) + 'A'; putchar(c); } return 0; }