标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 46701 Accepted Submission(s): 19038
1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 char str[110] ; 6 int i, n ; 7 while(~scanf("%d", &n)) 8 { 9 getchar() ; //为什么必须放在这边 ? 10 while(n--) 11 { 12 gets(str) ; 13 int len = strlen (str) ; 14 int a=0, b=0, c=0, d=0, e=0 ; 15 for(i=0; i<len; i++) 16 { 17 if(str[i] == ‘a‘) 18 a++ ; 19 if(str[i] == ‘e‘) 20 b++ ; 21 if(str[i] == ‘i‘) 22 c++ ; 23 if(str[i] == ‘o‘) 24 d++ ; 25 if(str[i] == ‘u‘) 26 e++ ; 27 } 28 printf("a:%d\n",a) ; 29 printf("e:%d\n",b) ; 30 printf("i:%d\n",c) ; 31 printf("o:%d\n",d) ; 32 printf("u:%d\n",e) ; 33 if(n!=0) 34 printf("\n") ; 35 } 36 } 37 return 0 ; 38 }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4665372.html