View Code of Problem 3857

#include<stdio.h>
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		int n;
		int count=0;
		scanf("%d",&n);
		int a[n];
		for(int 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