Everybody sit down in a circle. Ok. Listen to me carefully.
``Woooooo, you scwewy wabbit!''
Now, could someone tell me how many words I just said?
Input and Output
Input to your program will consist of a series of lines, each line containing multiple words (at least one). A ``word'' is defined as a consecutive sequence of letters (upper and/or lower case).
Your program should output a word count for each line of input. Each word count should be printed on a separate line.
Sample Input
Meep Meep! I tot I taw a putty tat. I did! I did! I did taw a putty tat. Shsssssssssh ... I am hunting wabbits. Heh Heh Heh Heh ...
Sample Output
2 7 10 9
注意:单词的定义是只含字母,a...a是2个单词
#define RUN #ifdef RUN #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <string> #include <iostream> #include <sstream> #include <map> #include <set> #include <vector> #include <list> #include <cctype> #include <algorithm> #include <utility> #include <math.h> using namespace std; #define MAXN 1000 int main(){ #ifndef ONLINE_JUDGE freopen("494.in", "r", stdin); freopen("494.out", "w", stdout); #endif char c; int cnt = 0; bool isword = false; while(scanf("%c", &c) != EOF){ if(c == '\n'){ if(isword){ cnt++; } printf("%d\n", cnt); cnt = 0; continue; } if(isalpha(c)){ isword = true; } if(!isalpha(c) && isword){ cnt++; isword = false; } } } #endif
相关推荐
KinderGarten,刘坤的作品,作为以后的资料参考用
Kindergarten游戏安装包,亲测可用。Kindergarten游戏安装包,亲测可用。
幼儿园游戏 apk 链接: ://www.dropbox.com/s/kcli6z8vwgrgrl1/KindergartenGame.apk dl
一个用于将kindergarten整合到VueJS应用程序中的VueJS2.0插件
vue-kindergarten, 为 Vue,Vuex,Vue路由器和Nuxt提供模块化安全 kindergarten幼儿园 简介幼儿园是一个用于 VueJS 2.0的插件,它将幼儿园插件集成到你的VueJS应用程序中。 它可以以帮助你在非常模块化的方式下授权...
Wordpress Kindergarten模板
kindergarten
幼儿园管理系统,按年龄排序后分别输出姓名、性别、年龄、身高、体重、出生日期
BME (www.bme.hu), 2005/2006。 第四学期,szglab4
Prediction of kindergarten reading success from preschool report of parents 304 Psychology in the Schools, July , 1976, Vol. I S , No. 3. of individual children. However, the hypothesis suggested ...
The kindergarten auditory screening test as a predictor of reading disability A Comparison of Three Measures 399 REFERENCES ARTHUR, G. The Arthur Adaptation of the Leiter Ii~ternational ...
The development of kindergarten behavior rating scales for the prediction of learning and behavior disorders THE DEVELOPMENT OF KINDERGARTEN BEHAVIOR RATING SCALES FOR THE PREDICTION OF LEARNING ...
司机端车辆认证及技能认证 提现 流水列表 评价列表
Effects of length of school day on kindergarten school performance and parent satisfaction Psychologv in the Schools 1982, 19, 238-242 EFFECTS O F LENGTH O F SCHOOL DAY ON KINDERGARTEN SCHOOL ...
Kindergarten_Backend
nikoniko_kindergarten
kindergarten-backend
ASP.NET MVC开发的幼儿园网站,完整功能,无数据库。包括首页、关于园所、新闻中心、精彩活动、宝宝园地、校园风采、联系我们等网站页面及后台。欢迎下载评价!
Characteristics of at-risk children in transitional and regular kindergarten programs Human Figure Drawings of Preschool Children 325 SWENSON, C. H. (1968). Empirical evaluation of human figure ...
Kindergarten reasoning and achievement in grades K-3 Psychology in fhe Schools Volume 20. J u l y . 1983 KINDERGARTEN REASONING AND ACHIEVEMENT IN GRADES K-3 VIRGINIA M. SILLIPHANT’ Holland ...