杭电acm2027题:求解错误原因
#include<iostream>#include<string>usingnamespacestd;intmain(){intn;while(cin>>n&&n!=0...
#include<iostream>#include<string>using namespace std;int main(){ int n; while(cin>>n&&n!=0){ getchar(); char str[n][101]; for(int i=0;i<n;++i){ cin.getline(str[i],101); } for(int x=0;x<n;++x){ int a=0,e=0,i=0,o=0,u=0; int str_len=strlen(str[x]); for(int y=0;y<str_len;++y){ char ch=str[x][y]; switch(ch){ case 97:++a;break; case 101:++e;break; case 105:++i;break; case 111:++o;break; case 117:++u;break; default:continue; } } cout<<"a:"<<a<<endl; cout<<"e:"<<e<<endl; cout<<"i:"<<i<<endl; cout<<"o:"<<o<<endl; cout<<"u:"<<u<<endl; if(x!=n-1){ cout<<endl; } } } return 0;}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询