#include <stdio.h>
#include <string.h>
int main()
{
char buf[110];
char *index[10];
char str[11];
char *next;
int count[10] = {0};
int c, i;
next = buf;
for (c = 0; c < 10; ) {
if (strcasecmp(str, "end") == 0) { // _stricmp
break;
}
for (i = 0; i < c; i++) {
if (strcmp(str
, index
[i
]) == 0) { break;
}
}
if (i == c) {
index[c] = next;
c++;
}
count[i]++;
}
for (i = 0; i < c; i++) {
printf("%2d:%-10s:%d件\n", i
+ 1, index
[i
], count
[i
]); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBtYWluKCkKewoJY2hhcglidWZbMTEwXTsKCWNoYXIJKmluZGV4WzEwXTsKCWNoYXIJc3RyWzExXTsKCWNoYXIJKm5leHQ7CglpbnQJY291bnRbMTBdID0gezB9OwoJaW50CWMsIGk7CgoJbmV4dCA9IGJ1ZjsKCWZvciAoYyA9IDA7IGMgPCAxMDsgKSB7CgkJcHJpbnRmKCLlhaXlipvmloflrZfliJctLT4iKTsKCQlzY2FuZigiJTEwcyIsIHN0cik7CgkJaWYgKHN0cmNhc2VjbXAoc3RyLCAiZW5kIikgPT0gMCkgewkvLyBfc3RyaWNtcAoJCQlicmVhazsKCQl9CgkJZm9yIChpID0gMDsgaSA8IGM7IGkrKykgewoJCQlpZiAoc3RyY21wKHN0ciwgaW5kZXhbaV0pID09IDApIHsKCQkJCWJyZWFrOwoJCQl9CgkJfQoJCWlmIChpID09IGMpIHsKCQkJc3RyY3B5KG5leHQsIHN0cik7CgkJCWluZGV4W2NdID0gbmV4dDsKCQkJYysrOwoJCQluZXh0ICs9IHN0cmxlbihzdHIpICsgMTsKCQl9CgkJY291bnRbaV0rKzsKCX0KCglwcmludGYoIioqKiDpm4boqIjntZDmnpwgKioqXG4iKTsKCWZvciAoaSA9IDA7IGkgPCBjOyBpKyspIHsKCQlwcmludGYoIiUyZDolLTEwczolZOS7tlxuIiwgaSArIDEsIGluZGV4W2ldLCBjb3VudFtpXSk7Cgl9CgoJcmV0dXJuIDA7Cn0K