View Code of Problem 3857

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	long long int T,i,n;
	cin>>T;
	while( T-- )
	{
		cin>>n;
		int cnt=0,temp;
		for( i=0;i<n;i++ )
		{
			cin>>temp;
			if( temp == 2 )
			{
				cnt++;
			 } 
		}
		cout<<cnt<<endl; 
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3857