#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. python 去除html 超链接href 如何实现?

    今天持久男 在抓取数据的时候发现很多内容都加了锚文本, 这怎么办呢? 没办法只能通过工具解决 我是这样解决的: 例如: soup = BeautifulSoup('<p>Hello < ...

  2. python基本面试题

    https://www.cnblogs.com/changwentao/p/9432166.html

  3. mysql linux utf-8 下中文乱码

    SET character_set_client='utf8'; SET character_set_connection='utf8'; SET character_set_results='utf ...

  4. Django学习笔记(二)视图函数

    一.url映射 1.为什么回去urls.py文件中找映射? 在‘settings.py’文件中配置了‘ROOT_URLCONF’为‘urls.py’.所有的django回去urls.py中寻找. 2. ...

  5. JSR-303 数据校验学习

    一.JSR-303简介JSR-303 是 JAVA EE 6 中的一项子规范,叫做 Bean Validation,官方参考实现是Hibernate Validator. 此实现与 Hibernate ...

  6. sed 删除文本

    sed删除文本命令可以将指定行或指定行范围进行删除,sed编辑命令的删除文本符号为 d,删除文本的格式为. [ sed]$ cat input [ sed]$ sed '/8/d' input 删除最 ...

  7. 024_mac配置屏保命令

    注意吃饭等离开工位的时候养成随时开启屏保的功能,养成信息保护的好习惯,mac如何配置屏幕保护呢? 一. 通过mac"设置"里的"Desktop & Screen ...

  8. 【medium】4. Median of Two Sorted Arrays 两个有序数组中第k小的数

    There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two ...

  9. pwnable.tw silver_bullet

    产生漏洞的原因 int __cdecl power_up(char *dest) { char s; // [esp+0h] [ebp-34h] size_t new_len; // [esp+30h ...

  10. C++11 double转化为string

    C++11转化double为string是一件很容易的事情. 方法: 1:使用C中的sprintf函数,这里就不说了. 2:使用std::ostringstream.这个与std::cout是一样的. ...