SWEA 2072

split과 형변환

T = int(input()) 

for tc in range(T): 
    
    numbers = input()
    
    numbers = numbers.split() 
    
    numbers = list(map(int, numbers))
    total = 0
    for number in numbers:
        if number % 2 == 1:
            total += number

    print(f'#{tc+1} {total}')
  

좋은 웹페이지 즐겨찾기