#include <stdio.h>
#include <string.h>
void countWord(FILE *fp, int *count)
{
char word[100];
if (fscanf(fp
, "%s", word
) == EOF
) return;
(*count)++;
countWord(fp, count);
}
int main()
{
FILE *fp;
int count;
fp
= fopen("a.doc", "r"); countWord(fp, &count);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCnZvaWQgY291bnRXb3JkKEZJTEUgKmZwLCBpbnQgKmNvdW50KQp7CiAgY2hhciB3b3JkWzEwMF07CiAgaWYgKGZzY2FuZihmcCwgIiVzIiwgd29yZCkgPT0gRU9GKQogICAgcmV0dXJuOwogIGlmIChzdHJsZW4od29yZCkgPj0gMikKICAgICgqY291bnQpKys7CiAgY291bnRXb3JkKGZwLCBjb3VudCk7Cn0KCmludCBtYWluKCkKewogIEZJTEUgKmZwOwogIGludCBjb3VudDsKICAKICBmcCA9IGZvcGVuKCJhLmRvYyIsICJyIik7CiAgY291bnRXb3JkKGZwLCAmY291bnQpOwogIGZjbG9zZShmcCk7CiAgCiAgcHJpbnRmKCIlZFxuIiwgY291bnQpOwogIAogIHJldHVybiAwOwp9Cg==