AtCoder B-Multi Test Cases

011010100·2023년 1월 25일

1. Problem Description

Find the odd numbers in N positive integers

2. Code

T = int(input())
for t in range(T):
    N = int(input()) 
    a = list(map(int, input().split()))
    count = 0
    for i in range(N):
        if (a[i] % 2 == 1):
            count += 1
    print(count)

3. Explanation

Loop for T times
N numbers are given for each test case, and if the number is odd, the number must be counted and printed

0개의 댓글