View Code of Problem 3857

#include<stdio.h>
int main()
{
	int n,m,tmp,i,count;
	scanf("%d",&n);
	while(n--){
		scanf("%d",&m);
		count=0;
		for(i=0;i<m;++i){
			scanf("%d",&tmp);
			if(tmp==2)
				count++;
		}
		printf("%d\n",count);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3857