标签:log bsp class vector cin string ++ har hdoj
#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--; } }
标签:log bsp class vector cin string ++ har hdoj
原文地址:http://www.cnblogs.com/theskulls/p/5998434.html