home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_05 / 8n05126a < prev    next >
Text File  |  1990-04-18  |  904b  |  30 lines

  1.  
  2.  
  3. -----listing 1----note: do not change formatting in first four lines----
  4.  
  5. #include <stdio.h>
  6. #define QQ      1
  7. #define TT         1
  8. #define cc main(c,v) int c; char **v;{char tt[12],qq[7];\
  9.   int q=0,o=1,l=1,m=1;struct {int c;} f;
  10. #define ouroboros qq[6]='\0';tt[11]='\0';if(QQ==atoi(v[1])+1)\
  11.   {(void)fprintf(stderr,"%s factorial = %d\n",v[1], TT);exit(1);}o=c+f
  12. #define x ;while(EOF!=(o=getchar())){if(l && q=='Q' && o=='Q')\
  13.   {l=0;(void)getchar();(void)fread(qq,6,1,stdin);(void)printf(\
  14.   "Q %6d",atoi(qq)+1);}else if(m && q=='T' && o=='T'){m=0;(void)\
  15.   fread(tt,11,1,stdin);(void)printf("T %9d\n",atoi(tt)*QQ);}else\
  16.   {q=o;(void)putchar(o);}}exit(0);}
  17. cc ouroboros.c -o x 
  18. #define zxc ;{/*
  19. cat ouroboros.c | x $1 > x1
  20. if [ $? -ne 0 ]; then
  21. exit
  22. fi
  23. mv x1 ouroboros.c
  24. chmod +x ouroboros.c
  25. exec ouroboros.c $1
  26. exit
  27. */
  28. ----------------end of listing 1---------------
  29.  
  30.