Advertisement
cd62131

Cipher

Feb 23rd, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define N 0xff
  4. void makeTable(char *c) {
  5.   int i, j, r;
  6.   for (i = 0; i <= N; i++) {
  7.     r = 1; j = 95;
  8.     while (j--) r = r * i % 323;
  9.     c[i] = r;
  10.   }
  11. }
  12. int main(void) {
  13.   char c[N];
  14.   int d;
  15.   makeTable(c);
  16.   while ((d = getchar()) != EOF) putchar(c[d]);
  17.   return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement