题目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
",len-1);
        }
         else printf("%d ",len);    
         
    }
    return 0;
} 
原文地址:https://www.cnblogs.com/jianrenguo/p/6509867.html