sdut oj 1250 统计元音

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

int main()
{
    char s[100], sc[5] = {'a', 'e', 'i', 'o', 'u'};
    int i, x, n, j, k;
    scanf("%d", &n);
    getchar();
    for(i = 0; i <= n - 1; i++)
    {
        gets(s);
        for(k = 0; k <= 4; k++)
        {
            x = 0;
            for(j = 0; s[j] != '\0'; j++)
            {
                if(sc[k] == s[j])
                x++;
            }
            printf("%c:%d\n", sc[k], x);
        }
        printf("\n");
    }

    return 0;
}

猜你喜欢

转载自blog.csdn.net/zx__zh/article/details/78919977
今日推荐