第十三周OJ项目统计元音字母个数
2014-11-20 15:11
344 查看
/* *Copyright (c)2014,烟台大学计算机学院 *All gight reserved. *文件名称:temp.cpp *作者:曾晓 *完成时间:2014年11月17日 *版本号:v1.0 */ #include <iostream> #include <cstdio> using namespace std; int main() { char ch[100]; int i=0,n1=0,n2=0,n3=0,n4=0,n5=0; gets(ch); while (ch[i]!='\0') { if (ch[i]=='a') n1++; else if (ch[i]=='e') n2++; else if (ch[i]=='i') n3++; else if (ch[i]=='o') n4++; else if(ch[i]=='u') n5++; i++; } cout<<"a:"<<n1<<endl; cout<<"e:"<<n2<<endl; cout<<"i:"<<n3<<endl; cout<<"o:"<<n4<<endl; cout<<"u:"<<n5<<endl; return 0; }
运行结果:
相关文章推荐
- 第十三周 oj平台 统计元音字母个数
- 第十三周OJ项目统计每个元音字母在字符串中出现的次数。
- 第十三周OJ平台(3):统计元音字母个数
- 第十三周OJ项目c:统计元音字母个数
- 第十三周 OJ平台统计元音字母个数
- 第十三周项目五 字符串操作(统计大/小写字母个数)
- 第十三周OJ项目3统计元音字母个数
- 第十三周 OJ平台-统计元音字母个数
- 第十三周OJ平台(3)统计元音字母个数
- 第十三周 OJ平台 C:统计元音字母个数
- 第十三周 项目5(1):统计每一个字母出现的个数
- 第十三周项目5---统计大小字母的个数
- 第13周 OJ平台(统计每个元音字母在字符串中出现的次数)
- 第十三周项目 5 字符串操作(字符统计)——统计其中大小写字母的个数
- 第十三周项目五字符串操作(1)统计字母A出现的次数
- 第十三周项目五——字符串操作(1)统计字母A出现的次数
- 第十三周项目五(2-2) 统计出现的大小写字母个数
- 第十三周 项目5:(1)统计字母“A”出现的个数
- 第十三周项目5-字符串的操作(统计字母 ' A ' 出现的次数)
- 第十三周项目五——字符串操作(1)统计字符串中大小写字母个数