View Code of Problem 3857

#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		int sum = 0;
		int a;
		cin >> n;
		while (n--) {
			cin >> a;
			if (a == 2) ++sum;
		}
		cout << sum << endl;

	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3857