#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的更多相关文章

  1. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9

    #include <iostream> #include <fstream> #include <cstdlib> #include <string> ...

  2. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8

    #include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...

  3. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6

    #include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...

  4. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5

    #include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...

  5. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4

    #include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...

  6. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3

    #include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...

  7. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2

    #include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...

  8. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1

    #include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...

  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9

    #include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...

随机推荐

  1. shell 批量远程主机执行命令

    [yunwei@Y24-209 ~]$cat ls.sh #!/bin/bash ip55=`cat ip1` for i in $ip55;do ping -c 1 $i if [ $? -eq 0 ...

  2. 自编译Apache Spark2.3.3支持CDH5.16.1

    1 下载源代码文件 https://archive.apache.org/dist/spark/spark-2.3.3/ 2 解压后导入编辑器,修改依赖的Hadoop版本,下面截图是修改后的,要看自己 ...

  3. css-reset 代码

    最常用 * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:bef ...

  4. spring security 学习笔记

    官方文档

  5. [转] word2vec

    from: https://www.cnblogs.com/peghoty/p/3857839.html 另附一个比较好的介绍:https://zhuanlan.zhihu.com/p/2630679 ...

  6. encode与decode

    import torch from torch import nn import numpy as np import matplotlib.pyplot as plt import torch.ut ...

  7. 关于npm镜像,发布,内网搭建等

    npm config set registry http://registry.npmjs.org npm config set registry https://registry.npm.taoba ...

  8. LightOJ 1348 (树链剖分 + 线段树(树状数组))

    题目 Link 分析 典型的树链剖分题, 树链剖分学习资料 Code #include <bits/stdc++.h> using namespace std; const int max ...

  9. Windows【端口被占用,杀死想啥的端口】

    windows 两步方法 netstat -ano | findstr "8080" taskkill /pid 4136-t -f linux 两步方法 ps -ef | gre ...

  10. JAVA 导包,使用前面的类~

    package Code413;/*1.导包,也就是指出需要使用的类,在什么位置import 包名称,类名称对于与当前同类属于同一个包的情况,可以省略导包语句不写..2.创建,格式:类名称 对象名=n ...