haju__log

[python][SWEA][D1] 2072. 홀수만 더하기 본문

SWEA

[python][SWEA][D1] 2072. 홀수만 더하기

haju 2023. 5. 4. 10:11

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&contestProbId=AV5QSEhaA5sDFAUq&categoryId=AV5QSEhaA5sDFAUq&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=1&pageSize=10&pageIndex=1 

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

T=int(input())

for test_case in range(1,T+1):
    result=0
    s=input()
    list1=s.split()
    for i in list1:
        if int(i)%2!=0:
            result +=int(i)
    print("#%d %d" %(test_case,result))
    s=input()
    list1=s.split()
    
    # 위의 코드 대신 아래로 쓰자!
    list1=list(map(int,input().split()))