1094: 统计元音(函数专题)

#include <stdio.h>
int vowel(char ch);
int main()
{
    char ch;
    int count = 0;
    while (scanf("%c", &ch) && ch != '\n')//输入一串字符
    {
        if (vowel(ch) == 1)
        {
            count++;
            /* code */
        }

        /* code */
    }
    printf("%d\n", count);
    return 0;
}
int vowel(char ch)
{
    int flag = 0;
    if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
    {
        flag = 1;
        /* code */
    }
    return flag;
}
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页