第1个回答 2011-10-15
#include<iostream>
main( )
{
int i,acount=0,icount=0;
char aa[100];
cin>>aa;
cout<<aa<<endl;
for (i=0;i<strlen(aa);i++)
{
if (aa[i]=='a')
{
acount++;
}
if (aa[i]=='i')
{
icount++;
}
}
cout<<"a有"<<acount<<"个,"<<"i有"<<icount<<"个。"<<endl;
}