View Code of Problem 3857

#include <stdio.h>
int main() {
    int n;
    int t;
    double x;
    int ans;
    scanf("%d", &t);
    while(t--) {
        scanf("%d", &n);
        ans = 0;
        for(int i = 0; i < n;i++) {
            scanf("%lf", &x);
            if(x == 2.0) ans++;
        }
        printf("%d\n", ans);
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3857