1 条题解

  • 0
    @ 2025-11-30 16:24:20

    C++ :

    #include <iostream>
    #include <string>
    using namespace std;
    int main() {
        string str;
        do {
            getline(cin, str);
            if (!str.empty()) {
                int vowelCount = 0;
                for (char ch : str) {
                    ch = tolower(ch);
                    if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
                        ++vowelCount;
                    }
                }
                cout << vowelCount << endl;
            }
        } while (!str.empty());
        return 0;
    }
    
    • 1

    信息

    ID
    587
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者