c = getchar ();
if ('0' <= c && c <= '9')
x = c - '0';
else
if ('A' <= c && c <= 'F')
x = c - 'A' + 10;
else
goto funny;
x <<= 4;
c = getchar ();
if ('0' <= c && c <= '9')
x |= c - '0';
else
if ('A' <= c && c <= 'F')
x |= c - 'A' + 10;
else {
funny:
fprintf (stderr, "Funny hex letter %c\n", c);
exit (2);
}
checksum += x;
return x;
}
main () {
register unsigned i, n;
char c, buf[64];
unsigned type;
do {
do {
c = getchar ();
if (c == EOF) {
fprintf (stderr, "Premature EOF colon missing\n");
exit (1);
}
} while (c != ':');
switch (type = getbyte ()) {
case 1:
break;
case 0:
for (i = 0; i < n; i++)
buf[i] = getbyte ();
fwrite (buf, 1, n, stdout);
break;
default:
fprintf (stderr, "Funny record type %d\n");
exit (1);
}