View Code of Problem 3857

#include<stdio.h>
#include<math.h>
#include<string.h>
//#include<algorithm>
#include <bits/stdc++.h>

using namespace std;


int main() {
	int T;
	scanf("%d",&T);
	while(T--) {
		int sum=0;
		int n;
		int temp;
		scanf("%d",&n);
		for(int i=0; i<n; i++) {
			scanf("%d",&temp);
			if(temp==2) {
				sum++;
			}
		}
		printf("%d\n",sum);
	}
}

Double click to view unformatted code.


Back to problem 3857