1.5.1 Word Counting(The wrong version)

作者在 2009-02-13 13:53:51 发布以下内容
#include <stdio.h>
 
#define OUT 0  /* outside word */
#define IN  1  /* inside word */
 
int main(void)
{
    int c, nw;
   
    nw = 0;
    while((c = getchar()) != EOF)
    {
        while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
            ;
        ++nw;
    }
    printf("the total is %d",nw);
   
    getch();
    return 0;
文章评论,共0条
游客请输入验证码
浏览27698次
文章归档