View Code of Problem 3857

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
int main() {
	int n;
	scanf("%d", &n);
	while (n--)
	{
		
		int m,num=0;
		scanf("%d",&m);
		int a[1000];
		for (int i = 0; i < m; i++)
		{
			scanf("%d",&a[i]);
			if (a[i]==2)
			{
				num++;
			}
		}
		printf("%d\n",num);
	}
 
	return 0;
}

Double click to view unformatted code.


Back to problem 3857