View Code of Problem 3857

#include<iostream>
#include<cstdio>

using namespace std;

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

Double click to view unformatted code.


Back to problem 3857