View Code of Problem 3857

#include<bits/stdc++.h>
using namespace std;

int main(){
	int T;
	cin>>T;
	while(T--){
		int n,a,count=0;
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>a;
			if(a==2)
				count++;
		}
		cout<<count<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3857