はまやんはまやんはまやん

hamayanhamayan's blog

New Year and Counting Cards [Good Bye 2017 A]

http://codeforces.com/contest/908/problem/A

(問題の言い換えが本質なのだが、あまりに冗長なので)
文字列が与えられるので、母音(aiueo)と奇数(13579)の文字数を答えよ。

解法

http://codeforces.com/contest/908/submission/33764758

stringのfindメソッドを使って判定した。

string S;
string ng = "aeiou13579";
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> S;

    int ans = 0;
    fore(c, S) if (ng.find(c) != string::npos) ans++;
    cout << ans << endl;
}