View Code of Problem 3857

#include<iostream>
using namespace std;
int main(void){
	int t;
	cin>>t;
	while(t--){
		int n,count=0;
		cin>>n;
		while(n--){
			int a;
			cin>>a;
			if(a==2) count++;
		}
		cout<<count<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3857