#include <stdio.h>
int str_chnum(const char st[], int ch)
{
int cnt = 0, i;
for (i = 0; st[i]; ++i)
if (st[i] == ch)++cnt;
return cnt;
}
int main()
{
char st[100], ch;
printf("その文字は%d個含まれています。\n", str_chnum
(st
, ch
));
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgc3RyX2NobnVtKGNvbnN0IGNoYXIgc3RbXSwgaW50IGNoKQp7CiAgaW50IGNudCA9IDAsIGk7CgogIGZvciAoaSA9IDA7IHN0W2ldOyArK2kpCiAgICBpZiAoc3RbaV0gPT0gY2gpKytjbnQ7CgogIHJldHVybiBjbnQ7Cn0KCmludCBtYWluKCkKewogIGNoYXIgc3RbMTAwXSwgY2g7CgogIHByaW50Zigi5paH5a2X5YiX44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GE77yaIik7CiAgZmdldHMoc3QsIDEwMCwgc3RkaW4pOwogIHByaW50Zigi5qSc57Si44GZ44KL5paH5a2X44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GE77yaIik7CiAgY2ggPSBnZXRjaGFyKCk7CiAgcHJpbnRmKCLjgZ3jga7mloflrZfjga8lZOWAi+WQq+OBvuOCjOOBpuOBhOOBvuOBmeOAglxuIiwgc3RyX2NobnVtKHN0LCBjaCkpOwoKICByZXR1cm4gMDsKfQ==