>>109 向け。ネタ考えてるうちに、マットウなのが来てしまって残念。
#include <stdio.h>
#include <string.h>
char memory[10000] = {0}; int count[10000] = {0}; void inc(char *s) {
char buf[100]; char *p; strcpy(buf, " "); strcat(buf, s); strcat(buf,
" "); p = strstr(memory, buf); if (p == NULL) { strcat(memory, buf); p
= strstr(memory, buf); } count[p - memory + 1]++; } void print(void) {
char *p; int i; for (p = memory; *p; *p++) if (*p == ' ') *p = '\0';
for (i = 0; i < 10000; i++) if (count[i]) printf("%s : %d\n", memory +
i, count[i]); } int main(void) { char buf[100]; while (scanf("%s",
buf) == 1) inc(buf); print(); return 0; }