View Code of Problem 3857

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	int t, n;
	scanf("%d",&n);
	while (n--)
	{
		int m, num = 0;
		scanf("%d", &m);
		int a[100];
		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