[恢]hdu 2027

2011-12-16 04:59:45

地址:http://acm.hdu.edu.cn/showproblem.php?pid=2027

题意:中文。

代码:

# include <stdio.h>
# include <string.h>


char str[110] ;


int main ()
{
int i, T, nCase = 1 ;
char tabstr[] = "aeiou" ;
int tab[300] ;
scanf ("%d%*c", &T) ;
while (T--)
{
gets(str) ;
memset (tab, 0, sizeof(tab)) ;
for (i = 0 ; str[i] ; i++)
tab[str[i]]++ ;
if (nCase++ != 1) printf ("\n") ;
for (i = 0 ; i < 5 ;i ++)
printf ("%c:%d\n", tabstr[i], tab[tabstr[i]]) ;

}
return 0 ;
}



原文地址:https://www.cnblogs.com/lzsz1212/p/2314933.html