View Code of Problem 3857

#include<stdalign.h>
int main()
{
    int t,i,j,n,a[1000],c;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        c=0;
        scanf("%d",&n);
        for(j=0;j<n;j++)
        {
            scanf("%d",&a[j]);
            if(a[j]==2)
                c++;
        }
        printf("%d\n",c);
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3857