1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| #include <iostream> #include <vector> #include <map>
using namespace std;
int main(){ int t; cin >> t >> ws;
map<char, vector<int>> m;
m['c'] = {0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1}; m['d'] = {0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0}; m['e'] = {0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0}; m['f'] = {0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0}; m['g'] = {0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}; m['a'] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}; m['b'] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}; m['C'] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}; m['D'] = {0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0}; m['E'] = {0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0}; m['F'] = {0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0}; m['G'] = {0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}; m['A'] = {0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}; m['B'] = {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
while(t--){ int prev[11] = {0}; int ans[11] = {0}; string s; getline(cin, s);
for(char sound : s){ for(int j = 1; j<=10; ++j){ if(m[sound][j] == 1){ if(prev[j] == 0){ ++ans[j]; prev[j] = 1; } } else prev[j] = 0; } }
for(int i=1; i<=10; ++i){ cout << ans[i] << (i==10 ? '\n' : ' '); } } return 0; }
|