http://acm.hdu.edu.cn/showproblem.php?pid=2027 登录后复制 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int main() 5 { 6 int n; 7 char a[102]; 8 scanf("%d",&n); 9 getchar(); 10 while(n--) 11 { 12 gets(a); 13 int l=strlen(a); 14 int b[256]; 15 memset(b,0,sizeof(b)); 16 char hash[]={'a','e','i','o','u'}; 17 for(int i=0;i<l;i++) 18 { 19 b[a[i]]++; 20 } 21 for(int i=0;i<5;i++) 22 { 23 printf("%c:%d\n",hash[i],b[hash[i]]); 24 } 25 26 if(n>0) 27 printf("\n"); 28 } 29 return 0; 30 } 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30. 原创作者: u_15481067 转载于: https://blog.51cto.com/u_15481067/11743000