#include <stdio.h> int main(){ char c; char pre_c=' '; int count=0; while (scanf("%c",&c)!=EOF && c!='\n'){ // printf("c=%c\n",c); if (pre_c!=' ' && c==' '){count++;} pre_c = c; } if (pre_c!=' ' && c=='\n'){count++;} if (pre_c!=' ' && c==' '){count++;} printf("%d",count); return 0; }
c语言编程练习题:7-141 统计一行文本的单词个数
作者:yunjinqi
类别:编程
日期:2023-05-31 17:21:11
阅读:574 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/266
最新文章
系统当前共有 404 篇文章