#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define IN 1
#define OUT 0
int main(int argc, char **argv)
{
int count = 0;
int status = OUT;
char c;
while ( (c = getchar()) != EOF) {
if (c != ' ' && c != '\t' && c != '\n') {
if (status == OUT) {
status = IN;
count++;
}
} else
status = OUT;
}
printf("word count: %d\n", count);
exit(EXIT_SUCCESS);
}
单词统计
最新推荐文章于 2018-03-31 18:51:44 发布