#include <iostream> #include <cstdio> using namespace std; const int SIZE=100; int main() { char letter[100]; int a,e,i,o,u,n=0; a=e=i=o=u=0; gets(letter); while(letter[n]!='\0') { if(letter[n]=='a') a++; else if(letter[n]=='e') e++; else if(letter[n]=='i') i++; else if(letter[n]=='o') o++; else if(letter[n]=='u') u++; n++; } cout<<"a: "<<a<<endl<<"e: "<<e<<endl<<"i: "<<i<<endl<<"o: "<<o<<endl<<"u: "<<u<<endl; return 0; }
时间: 2024-10-15 18:52:58