Problem : 2027 ( 统计元音 ) Judge Status : AcceptedRunId : 6000830 Language : C Author : qq1203456195Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <
string.h>
4 int seq1[
5]={
'a',
'e',
'i',
'o',
'u'};
5 int seq2[
30];
6 int main()
7 {
8 char str[
101];
9 int i,n;
10 scanf(
"%d",&
n);
11 getchar();
12 while (n--
)
13 {
14 gets(str);
15 memset(seq2,
0,
sizeof(seq2));
16 i=
0;
17 while (str[i]!=
'\0')
18 {
19 if(str[i]!=
' ') seq2[(str[i]-
'a')]++
;
20 i++
;
21 }
22 i=
0;
23 while (i<
5)
24 {
25 printf(
"%c:%d\n",seq1[i],seq2[(seq1[i]-
'a')]);
26 i++
;
27 }
28 if(n!=
0) printf(
"\n");
29 }
30 return 0;
31 }
转载于:https://www.cnblogs.com/CheeseZH/archive/2012/05/26/2519024.html
相关资源:数据结构—成绩单生成器
转载请注明原文地址: https://win8.8miu.com/read-1494576.html