首页 > 代码库 > hdoj:2027

hdoj:2027

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin >> n;
    string t;
    getline(cin, t);
    while (n >= 1)
    {
        string s;
        int a = 0, e = 0, i = 0, o = 0,u=0;
        getline(cin, s);
        for (char &c : s)
        {
            if (c == a)
                a++;
            else if (c == e)
                e++;
            else if (c == i)
                i++;
            else if (c == o)
                o++;
            else if (c == u)
                u++;
        }
        cout << "a:" << a << endl;
        cout << "e:" << e << endl;
        cout << "i:" << i << endl;
        cout << "o:" << o << endl;
        cout << "u:" << u << endl;
        if (n!=1)
            cout << endl;
        n--;
    }
}

 

hdoj:2027