题目1182:统计单词--------------------这是何等尼玛的题,请注意我的统计方式!!!!!!

#include<stdio.h>
#include<stdlib.h>
#include<cstring>//三个头文件必不可少
int main()
{
    char *str=(char *)malloc (sizeof(char));//char*必须分配内存
    while(scanf("%s",str)!=EOF)//char*的scanf没有&
    {
        int i=0,count=0;
        int len=strlen(str);
        if (str[len-1]=='.'){
            printf("%d\n",len-1);
        }
         else printf("%d ",len);    
         
    }
    return 0;
} 

 

posted @ 2017-03-06 14:37  贱人郭  阅读(84)  评论(0编辑  收藏  举报