#include<bits/stdc++.h> using namespace std; int T, n, t; int main() { cin >> T; while (T--) { int cnt = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> t; if (t == 2) cnt++; } cout << cnt << endl; } return 0; } |
Double click to view unformatted code.