2023-05-28 11:15:50 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2023-06-06 03:22:44 +00:00
|
|
|
int prevseen = 0;
|
2023-05-28 11:15:50 +00:00
|
|
|
static char *buf = NULL;
|
|
|
|
static size_t size = 0;
|
2023-05-28 19:04:04 +00:00
|
|
|
long n = 1;
|
|
|
|
while(getline(&buf, &size, stdin) > 0)
|
2023-05-28 11:15:50 +00:00
|
|
|
{
|
2023-06-06 03:22:44 +00:00
|
|
|
if (n++ < 5)
|
2023-05-28 11:15:50 +00:00
|
|
|
continue;
|
|
|
|
if (strncmp(buf,"-->", 3) == 0)
|
2023-06-06 03:22:44 +00:00
|
|
|
{
|
|
|
|
if (!prevseen)
|
|
|
|
{
|
|
|
|
prevseen = 1;
|
|
|
|
putchar('\n');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prevseen = 0;
|
|
|
|
}
|
|
|
|
}
|
2023-05-28 19:04:04 +00:00
|
|
|
else if (buf[0] != 10)
|
|
|
|
fputs(buf, stdout);
|
2023-05-28 11:15:50 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|