编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
string words;
int yy=0;
int fy=0;
int other=0;
cout<<"Enter words (q to quit):\n";
while(cin>>words)
{
if(isalpha(words[0]))
{
if(words[0]=='q' && (words.size())==1)
break;
else
{
switch(words[0])
{
case 'a':
case 'o':
case 'e':
case 'i':
case 'u':
yy++;
break;
default:fy++;
}
}
}
else
other++;
}
cout<<yy<<" words beginning with vowels"<<endl;
cout<<fy<<" words beginning with consonants"<<endl;
cout<<other<<" others"<<endl;
system("pause");
return 0;
}
编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7的更多相关文章
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9
#include <iostream> #include <fstream> #include <cstdlib> #include <string> ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8
#include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6
#include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5
#include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4
#include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3
#include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2
#include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1
#include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9
#include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...
随机推荐
- 有关mysql索引
1.首先我们需要明确一下什么是索引以及为什么要使用索引: 索引在MySQL中也叫做“键”,是存储引擎用于快速找到记录的一种数据结构.在生产环境中,对于数据库我们最常进行的是查询的操作,而当我们的数据非 ...
- edx的ST
卷积概率论 顺便了解了一下卷积函数 反正以后学CNN还要再看 这个mit老师水平真的不太行 倒是以这个为源头找到不少好的youtube视频 看看她题目出的怎么样吧... cousera今天估计没时间了
- OSL
1,SimpleColorShader: shader gamma(color cin = color(,,),output color Cout=color(,,)) { Cout = cin; } ...
- 三、vue之router
三.vue之router 此时vue的脚手架.创建项目已经完成. ... vue的运行流程 index.html-->main.js-->App.vue-->router/index ...
- Java面试题 静态代码块 构造代码块 构造方法 的执行顺序
JAVA中的静态代码块 构造代码块 构造方法执行顺序: 静态代码块(类加载时执行)>>构造代码块>>构造方法 下面展示一个简单的例子,推荐大家动手运行一遍: public cl ...
- UiAutomator2.0 - 控件实现点击操作原理
目录 一.UiObject 二.UiObject2 穿梭各大技术博客网站,每天都能看到一些的新的技术.突然感觉UiAutomator 2.0相对于现在来说已经是个很久远的东西了ε=(´ο`*))).写 ...
- 2018开源中国最受欢迎的中国软件MyBatis-Plus
2018开源中国最受欢迎的中国软件MyBatis-Plus 官方网址:https://mp.baomidou.com 中国软件,中文文档 什么是MyBatis-Plus? 进入官方第一句话:为简化开发 ...
- Interactive map of Linux kernel
Interactive map of Linux kernel 2.6.36 : http://www.makelinux.net/kernel_map/ 注: 图中函数名带连接
- 从Uber微服务看最佳实践如何炼成?
导读:Uber成长非常迅速,工程师团队快速扩充,据说Uber有2000名工程师,8000个代码仓库,部署了1000多个微服务.微服务架构是Uber应对技术团队快速增长,功能快速上线很出色的解决方案.本 ...
- 【转】【Android】1分钟不用改任何代码在Eclipse中使用AAR
原文:https://www.jianshu.com/p/ccf306e08d5b?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=t ...