|
|
1.1 ! root 1: #ifndef lint ! 2: static char sccsid[] = "@(#)comp.c 4.1 12/24/82"; ! 3: #endif ! 4: ! 5: #include <stdio.h> ! 6: #define MAX ' ' ! 7: ! 8: char new[MAX], old[MAX]; ! 9: ! 10: main () ! 11: { ! 12: register int i, j; ! 13: old[0] = '\0'; ! 14: while (fgets(&new[0], MAX, stdin) != NULL) { ! 15: for (i=0; i<MAX && old[i]==new[i]; i++); ! 16: if (i >= MAX) { ! 17: fprintf(stderr, "long word\n"); ! 18: exit(1); ! 19: } ! 20: putc(i, stdout); ! 21: for (j=0; (old[j]=new[j]) != '\n'; j++); ! 22: old[j] = '\0'; ! 23: fputs(&old[i], stdout); ! 24: } ! 25: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.