View Code of Problem 3857

#include<iostream>
using namespace std;

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int num,count=0,digit;
		cin>>num;
		for(int i=0;i<num;i++)
		{
			cin>>digit;
			if(digit==2)
			{
				count++;
			}
		}
		cout<<count<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3857