文章
25
粉丝
364
获赞
68
访问
237.2k
 
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
    char s[1000];
    int cnt=0;
    while (gets(s))
    {
        for (int i = 0; s[i] != '\0'; i++)
        {
            if ((s[i]==' '||s[i]=='.')&&cnt!=0)
            {
                printf("%d ",cnt);
                cnt=0;
            }
            else
            {
                cnt++;
            }         
        }  
        printf("\n");    
    }                      
    //system("pause");
    return 0;
}
登录后发布评论
暂无评论,来抢沙发