View Code of Problem 3857

#include<iostream>
using namespace std;
const int N = 1010;
int a[N];
int main()
{
	int t;
	cin >> t;
	while(t --)
	{
		int n;
		int ans = 0;
		cin >> n;
		for(int i = 0;i < n;i ++)
		{
			cin >> a[i];
			if(a[i] == 2) ans ++;
		}
		
			
		cout << ans << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3857