View Code of Problem 3857

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

Double click to view unformatted code.


Back to problem 3857