View Code of Problem 3857

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int i,j,k,n,t;
	int a[1000];
	scanf("%d",&t);
	while(t--)
	{
		int count=0;
		scanf("%d",&n);
		for(i=0;i<n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]==2)
			{
				count++;
			}
		}
		printf("%d\n",count);
	}
}

Double click to view unformatted code.


Back to problem 3857