/*======================================================================= 求字母的个数 总时间限制: 1000ms 内存限制: 65536kB 描述 在一个字符串中找出元音字母a,e,i,o,u出现的次数。 输入 输入一行字符串(字符串中可能有空格,请用gets(s)方法把一行字符串输入到字符数组s中),字符串长度小于80个字符。 输出 输出一行,依次输出a,e,i,o,u在输入字符串中出现的次数,整数之间用空格分隔。 样例输入 If so, you already have a Google Account. You can sign in on the right. 样例输出 5 4 3 7 3 提示 注意,只统计小写元音字母a,e,i,o,u出现的次数。 注意:这个题输入字符串要用gets(s)来输入含有空格的字符串 =========================================================================*/ #include<stdio.h> #include<string.h> int main() { char s[90]; int j,len; int a,e,i,o,u; a=e=i=o=u=0; gets(s); len=strlen(s); for(j=0;j<len;j++) { if(s[j]=='a') a++; else if(s[j]=='e') e++; else if(s[j]=='i') i++; else if(s[j]=='o') o++; else if(s[j]=='u') u++; } printf("%d %d %d %d %d ",a,e,i,o,u); return 0; }