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. Windows 的 80 端口被 System 进程占用解决方案

    通过 Windows 的资源监视器(win+R:resmon)可以看到 80 端口已经被占用,下图是已经解决好了,没能截图被占用的情况,下面给出解决方案. PS:贴出两个好用的 windows cmd ...

  2. windows 和 mac 文件夹共享问题汇总

    目标:windows上的文件夹,共享给MAC,mac可以将文件复制到windows上来 windows设置共享文件夹,然后在mac上访问 假设win的ip地址是10.10.27.11,则mac上远程方 ...

  3. 调用本地摄像头并通过canvas拍照

    首先我们需要新建一个video标签,并且放到html里边 var video = document.createElement("video"); video.autoplay=& ...

  4. nginx的四个基本功能

    Nginx能做什么 1.反向代理2.负载均衡3.HTTP服务器(包含动静分离)4.正向代理 以上就是做网站小编了解到的Nginx在不依赖第三方模块能处理的事情,下面详细说明每种功能怎么做 1.反向代理 ...

  5. What every computer science major should know 每一个计算机科学专业的毕业生都应该都知道的

    Given the expansive growth in the field, it's become challenging to discern what belongs in a modern ...

  6. @Service ,@Controller,@Component注解

    首先,在applicationContext.xml文件中加一行: <context:component-scan base-package="com.hzhi.clas"/ ...

  7. Django-2.2.1学习感悟

    或许是看的教程比较老,跟不上2.2.1版本的Django,所以在编写代码时可以说是bug不断,这算是编程必经阶段 每当遇到django的bug logging,先看头几行再看最后几行,能自己解决最好, ...

  8. os模块和sys模块

    1.os模块与path有关:os.path.isfile():判断置顶对象是否为文件,是返回True,否返回Falseos.path.isdir():判断指定对象是否为目录,是返回True,否返回Fa ...

  9. Boost Asio教程集合

    http://zh.highscore.de/cpp/boost/ 第七章 https://mmoaay.gitbooks.io/boost-asio-cpp-network-programming- ...

  10. 快速乘O(1)和O(log)

    O(1)快速乘来自骆可强:<论程序底层优化的一些方法与技巧> //O(1)快速乘 inline LL quick_mul(LL x,LL y,LL MOD){ x=x%MOD,y=y%MO ...