UVA_494:Kindergarten Counting Game

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的更多相关文章
- Kindergarten Counting Game - UVa494
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva494.html 题目描述 Kin ...
- 494 - Kindergarten Counting Game
Kindergarten Counting Game Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, ...
- UVA 494 Kindergarten Counting Game
题目大意:输入一个字字符串,输出该字符串中所包含的"word"个数,其中"word"是指连续的字母(大小写均可) 题目思路:其实这是道水题,不过我考虑的时候,太 ...
- uva494 Kindergarten Counting Game
#include<bits/stdc++.h>using namespace std;int main(){ int n=0; char a; int flag=1; while((sca ...
- UVA 494 Kindergarten Counting Game map
Everybody sit down in a circle. Ok. Listen to me carefully.“Woooooo, you scwewy wabbit!”Now, could s ...
- Zerojudge解题经验交流
题号:a001: 哈囉 背景知识:输出语句,while not eof 题号:a002: 簡易加法 背景知识:输出语句,while not eof,加法运算 题号:a003: 兩光法師占卜術 背景知识 ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- UVa OJ 494
Kindergarten Counting Game Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, ...
随机推荐
- HDFS的Web界面
- mybatis学习:mybatis注解开发一对多
实体类User: public class User implements Serializable { private Integer id; private String username; pr ...
- Luogu P1712 [NOI2016]区间(线段树)
P1712 [NOI2016]区间 题意 题目描述 在数轴上有 \(N\) 个闭区间 \([l_1,r_1],[l_2,r_2],...,[l_n,r_n]\) .现在要从中选出 \(M\) 个区间, ...
- Leetcode106. Construct Binary Tree from Inorder and Postorder Traversal中序后续构造二叉树
根据一棵树的中序遍历与后序遍历构造二叉树. 注意: 你可以假设树中没有重复的元素. 例如,给出 中序遍历 inorder = [9,3,15,20,7] 后序遍历 postorder = [9,15, ...
- Liferay 7:Liferay DXP解决方案
分享是美德,欢迎探讨技术 这个作者很厉害呀,写的博客都是解决很刁钻问题的.强烈推荐 http://www.liferaysolution.com/2017/06/captcha-recaptcha-w ...
- 通过游戏学python 3.6 第一季 第九章 实例项目 猜数字游戏--核心代码--猜测次数--随机函数和屏蔽错误代码--优化代码及注释--简单账号密码登陆--账号的注册查询和密码的找回修改--锁定账号--锁定次数--菜单功能'menufile
通过游戏学python 3.6 第一季 第九章 实例项目 猜数字游戏--核心代码--猜测次数--随机函数和屏蔽错误代码--优化代码及注释--简单账号密码登陆--账号的注册查询和密码的找回修改--锁 ...
- ubuntu 软件的更新及解决软件中心自己无法打开
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install --reinstall software-center
- org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.hs.model.StudentModel]: No default constructor found; nested exception is java.lang.NoSuchMethodException: c
root cause org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [c ...
- 学习Python笔记---if 语句
条件测试 每条if语句的核心都是一个值为True或False的表达式,这种表达式被称为条件测试.Python根据条件测试的值True还是False来决定是否执行if语句中的代码.如果条件测试的值为Tr ...
- win10 下安装docker,创建镜像,push镜像到私有仓库,创建私有仓库,修改镜像仓库地址
通过连接下载window docker安装文件,https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.ex ...