您的位置:首页 > 其它

第十三周oj平台项目三:统计元音字母

2014-11-25 16:13 190 查看
#include <iostream>
#include<cstdio>
using namespace std;

int main()
{
char str[100];
int X=0,A=0,E=0,I=0,O=0,U=0;
gets(str);
while(str[X]!='\0')
{
if(str[X]=='a')A++;
else if(str[X]=='e')E++;
else if(str[X]=='i')I++;
else if(str[X]=='o')O++;
else if(str[X]=='u')U++;
X++;
}
cout<<"a:"<<A<<endl;
cout<<"e:"<<E<<endl;
cout<<"i:"<<I<<endl;
cout<<"o:"<<O<<endl;
cout<<"u:"<<U<<endl;
return 0;
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: