#include<iostream> #include<string> using namespace std; int main() { int n; while(cin>>n&&n>0) { while(n--) { char s[100]; int i,m,a=0,b=0,c=0,d=0,e=0; cin>>s; m=strlen(s); for(i=0;i<m;i++) { if(s[i]=='a') a++; else if(s[i]=='e') b++; else if(s[i]=='i') c++; else if(s[i]=='o') d++; else if(s[i]=='u') e++; } if(n==0) { cout<<"a:"<<a<<endl; cout<<"e:"<<b<<endl; cout<<"i:"<<c<<endl; cout<<"o:"<<d<<endl; cout<<"u:"<<e<<endl; } else { cout<<"a:"<<a<<endl; cout<<"e:"<<b<<endl; cout<<"i:"<<c<<endl; cout<<"o:"<<d<<endl; cout<<"u:"<<e<<endl; cout<<'\n'; } a=0,b=0,c=0,d=0,e=0; } } return 0; }
c++ hdoj 2027 统计元音
最新推荐文章于 2023-05-10 19:15:50 发布