#include<bits/stdc++.h> using namespace std; #define max 50 int main(){ int n,m,k; cin>>n; while(n--){ cin>>m; int a[3] = { }; for(int i = 0;i<m;i++){ cin>>k; if(k==2)a[k]++; } cout<<a[2]<<endl; } return 0; } |
Double click to view unformatted code.