home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / crypto / rot13.c < prev    next >
Encoding:
C/C++ Source or Header  |  2003-06-11  |  336 b   |  20 lines

  1. #include <stdio.h>
  2.  
  3. main()   /* streamlined version of copy input to output */
  4. {
  5.     int c;
  6.  
  7.     while ((c =getchar()) !=EOF)
  8.        {
  9.        if( c>= 97 && c <= 109 )
  10.           c=c+13;
  11.        else if( c >= 110 && c <= 122 )
  12.           c=c-13;
  13.           else if( c >= 65 && c <= 77 )
  14.          c=c+13;
  15.          else if( c >= 78 && c <= 90 )
  16.             c=c-13;
  17.         putchar(c);
  18.         }
  19. }
  20.