encrypted jokes

450 views
Skip to first unread message

utcsrgv!dave

unread,
Oct 8, 1982, 10:34:47 AM10/8/82
to
For those who are complaning they can't read shifted jokes, here is
the thirty-seconds' worth of code to read it:
====================================================
#include <stdio.h>
#define SHIFT 13
char fix();
main()
{
char c;
while((c=getchar()) != EOF)
putchar(fix(c));
}
char fix(c)
char c;
{
if(c >= 'a' && c <= 'z')
{
c -= SHIFT;
if(c < 'a')
c += 26;
}
if(c >= 'A' && c <= 'Z')
{
c -= SHIFT;
if(c < 'A')
c += 26;
}
return(c);
}
====================================================
Reply all
Reply to author
Forward
0 new messages