Language: C++ 4.8.2

#include<stdio.h>
#include<ctype.h>
int main(void)
{
int ch;
int word_count = 0;
int in_word = 1; // 标志变量辅助字符串读入
while((ch=getchar()) != EOF)
{
if(ch == '\n')
{
printf("%d\n", word_count);
word_count = 0;
in_word = 1;
}
else if(isalpha(ch))
{
if(in_word)
{
word_count++;
in_word = 0;
} }
else
{
in_word = 1;
}
}
}

UVA_494:Kindergarten Counting Game的更多相关文章

  1. Kindergarten Counting Game - UVa494

    欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva494.html 题目描述  Kin ...

  2. 494 - Kindergarten Counting Game

     Kindergarten Counting Game  Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, ...

  3. UVA 494 Kindergarten Counting Game

    题目大意:输入一个字字符串,输出该字符串中所包含的"word"个数,其中"word"是指连续的字母(大小写均可) 题目思路:其实这是道水题,不过我考虑的时候,太 ...

  4. uva494 Kindergarten Counting Game

    #include<bits/stdc++.h>using namespace std;int main(){ int n=0; char a; int flag=1; while((sca ...

  5. UVA 494 Kindergarten Counting Game map

    Everybody sit down in a circle. Ok. Listen to me carefully.“Woooooo, you scwewy wabbit!”Now, could s ...

  6. Zerojudge解题经验交流

    题号:a001: 哈囉 背景知识:输出语句,while not eof 题号:a002: 簡易加法 背景知识:输出语句,while not eof,加法运算 题号:a003: 兩光法師占卜術 背景知识 ...

  7. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  8. 【索引】Volume 0. Getting Started

    AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...

  9. UVa OJ 494

     Kindergarten Counting Game  Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, ...

随机推荐

  1. MySQL与Oracle差异函数对比

    ORACLE:select round(1.23456,4) value from dual MYSQL:select round(1.23456,4) value 2 abs(-1) abs(-1) ...

  2. linux下文件操作之cp和mv

    Linux CP文件夹略过目录的解决 root@QGY:/home/qgy# cp image/newimage_raw /mnt/4T/qin/cp: 略过目录'image/newimage_raw ...

  3. python 数据组合

  4. RQNOJ PID141 / 寻找代表元 [2017年6月计划 二分图01]

    PID141 / 寻找代表元 ☆ 提交你的代码 查看讨论和题解 1分前 我的状态 已通过 2017-06-28 21:03:46 运行耗时:31 ms 运行内存:28048 KB 查看最后一次评测记录 ...

  5. thinkcmf 导航高亮制作方法(适用于多级导航)(通用)

    平时用thinkcmf网站开发经常需要导航点击之后高亮,就写了一些实现方法分享一下. 思路很简单,先获取当前页面的顶级栏目的地址,然后与导航中的地址比较,相同的就加上一个class,把下面函数理解了不 ...

  6. centos下nginx无法加载php文件,404

    前提:html文件可以正常加载,php安装正常,nginx配置正确.仍然无法加载php文件,明明文件是存在,却报404,而不是直接输出文件 原因是:未启动php-fpm,未开启9000端口 首先查看是 ...

  7. 批处理启动应用程序(win)

    @echo off net session >nul 2>&1 " ( echo Oops: This tools must run with administrator ...

  8. selenium(4):初次尝试,通过百度进行搜索

    实现场景:打开chrome浏览器后,打开百度,再搜索栏里输入‘测试’,点击搜索按钮. 代码:定位方式,通过元素的ID. 定位技巧: ①鼠标定位需要定位的输入框,鼠标右键单击.选择检查. ②即可轻松的查 ...

  9. org.dom4j.Document 解析xml

    1.Java代码 Document doc = DocumentHelper.parseText(xml); // Element rootE = doc.getRootElement(); List ...

  10. 分布式--ActiveMQ 消息中间件(一) https://www.jianshu.com/p/8b9bfe865e38

    1. ActiveMQ 1). ActiveMQ ActiveMQ是Apache所提供的一个开源的消息系统,完全采用Java来实现,因此,它能很好地支持J2EE提出的JMS(Java Message ...