projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
date and time created 83/08/11 20:49:31 by sam
[unix-history]
/
usr
/
src
/
old
/
boggle
/
comp.c
#ifndef lint
static char
sccsid
[] =
"@(#)comp.c 4.1 %G%"
;
#endif
#include <stdio.h>
#define MAX
' '
char
new
[
MAX
],
old
[
MAX
];
main
()
{
register
int
i
,
j
;
old
[
0
] =
'\0'
;
while
(
fgets
(&
new
[
0
],
MAX
,
stdin
) !=
NULL
) {
for
(
i
=
0
;
i
<
MAX
&&
old
[
i
]==
new
[
i
];
i
++);
if
(
i
>=
MAX
) {
fprintf
(
stderr
,
"long word
\n
"
);
exit
(
1
);
}
putc
(
i
,
stdout
);
for
(
j
=
0
; (
old
[
j
]=
new
[
j
]) !=
'
\n
'
;
j
++);
old
[
j
] =
'\0'
;
fputs
(&
old
[
i
],
stdout
);
}
}