View Code of Problem 3857

#include<iostream>
#include<cstring>
using namespace std;
int main(){
    long long int t;
	cin>>t; 
	while(t--)
	{
		int n;
		cin>>n;
		int cnt=0;
		while(n--)
		{
			int z;
			cin>>z;
			if(z==2)
				cnt++;
		}
		cout<<cnt<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3857