UVa OJ 494
| Kindergarten Counting Game |
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
#include <stdio.h>
#include <string.h>
#define maxn 1000
int main()
{
int i,count = ;
char buf[maxn];
while (fgets(buf, sizeof(buf), stdin))
{
for (i = ; i < strlen(buf); i++)
if ((buf[i + ] < || buf[i + ] > ) && (buf[i] <= && buf[i] >= ))
count++;
printf("%d\n", count);
count = ;
}
return ;
}
报告:较易,暂无
问题:无
解决:无
UVa OJ 494的更多相关文章
- uva oj 567 - Risk(Floyd算法)
/* 一张有20个顶点的图上. 依次输入每个点与哪些点直接相连. 并且多次询问两点间,最短需要经过几条路才能从一点到达另一点. bfs 水过 */ #include<iostream> # ...
- UVa OJ 194 - Triangle (三角形)
Time limit: 30.000 seconds限时30.000秒 Problem问题 A triangle is a basic shape of planar geometry. It con ...
- UVa OJ 175 - Keywords (关键字)
Time limit: 3.000 seconds限时3.000秒 Problem问题 Many researchers are faced with an ever increasing numbe ...
- UVa OJ 197 - Cube (立方体)
Time limit: 30.000 seconds限时30.000秒 Problem问题 There was once a 3 by 3 by 3 cube built of 27 smaller ...
- UVa OJ 180 - Eeny Meeny
Time limit: 3.000 seconds限时3.000秒 Problem问题 In darkest <name of continent/island deleted to preve ...
- UVa OJ 140 - Bandwidth (带宽)
Time limit: 3.000 seconds限时3.000秒 Problem问题 Given a graph (V,E) where V is a set of nodes and E is a ...
- 548 - Tree (UVa OJ)
Tree You are to determine the value of the leaf node in a given binary tree that is the terminal nod ...
- UVa OJ 10300
Problem A Ecological Premium Input: standard input Output: standard output Time Limit: 1 second Memo ...
- UVa OJ 10071
Problem B Back to High School Physics Input: standard input Output: standard output A particle has i ...
随机推荐
- HDU4280 Island Transport —— 最大流 ISAP算法
题目链接:https://vjudge.net/problem/HDU-4280 Island Transport Time Limit: 20000/10000 MS (Java/Others) ...
- java基础知识一
1.计算机基础知识概述 (1) 计算机 计算机(computer)俗称电脑,是一种用于高速计算的电子计算机器,可以进行数值计算,又可以进行逻辑计算,还具有存储记忆功能.是能够按照程序运行,自动.高速处 ...
- 小米2在Eclipse 调试,要注意下列步骤。(转)
小米2在Eclipse 调试,要注意下列步骤.1.连接线,打开设置:USB线连接小米2,在设置-->开发者选项->USB 调是打开.如果这一步,就业在Eclipse中真机调试,下面的步骤不 ...
- DGA聚类 使用DBScan
features = sc.parallelize(data_group[idx]).map(lambda x: (x.host_ip+'^'+x.domain, 1)).reduceByKey(op ...
- 基于C#实现Windows服务状态启动和停止服务的方法
网址:http://www.jb51.net/article/89230.htm
- java中io类型及成熟io框架
就io本身而言,概念上有5中模型:blocking I/O, nonblocking I/O, I/O multiplexing(select and poll), singal driven I/O ...
- I.MX6 新版、旧版u-boot不兼容问题
/************************************************************************* * I.MX6 新版.旧版u-boot不兼容问题 ...
- 安装PostgreSQL数据库(Linux篇)
0.编译环境 Linux: CentOS 5.5 gcc: 4.1.2 1. 安装PostgreSQL 1) 解压postgresql-9.1.7.tar.bz2 #tar jxvf postgres ...
- 移植tslib库出现selected device is not a touchscreen I understand的解决方法
首发平台:微信公众号baiwenkeji 很多人在做触摸屏驱动实验,移植tslib库时,可能会出现错误提示“selected device is not a touchscreen I underst ...
- ASP.NET Core:WebAppCoreReact
ylbtech-ASP.NET Core:WebAppCoreReact 1.返回顶部 1. 2. 3. 4. 5. 6. 7. 2. wwwroot 返回顶部 3. Clie ...