View Code of Problem 3857

#include<stdio.h>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
int main(){

    int t,n,i,a[10000];
	scanf("%d",&t);
	while(t--){
		int cnt=0;
		scanf("%d", &n);
		for(i=0;i<n;i++){
			scanf("%d",&a[i]);
			if(a[i]==2) cnt++;
		}
		 printf("%d\n",cnt);
    }
	return 0; 
} 

Double click to view unformatted code.


Back to problem 3857