간단한 369 게임

 

SW Expert Academy

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

swexpertacademy.com

 

N = int(input())
result = []

for n in range(1, N+1):
    numStr = str(n)
    count = 0
    if numStr.find("3") > -1:
        count += numStr.count("3")
    if numStr.find("6") > -1:
        count += numStr.count("6")
    if numStr.find("9") > -1:
        count += numStr.count("9")

    if count == 0:
        result.append(str(n))
    else:
        result.append("-" * count)
print(' '.join(result))
728x90

파리 퇴치 

 

SW Expert Academy

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

swexpertacademy.com

 

T = int(input())

for t in range(1, T+1):
    N, M = map(int, input().split())
    arr = []
    # create map
    for n in range(N):
        arr.append(list(map(int, input().split())))
    result = []
    # 0 ~ N-1
    for i in range(N-M+1):
        for j in range(N-M+1):
            mSum = 0
            for mi in range(i, i+M):
                for mj in range(j, j+M):
                    mSum += arr[mi][mj]
            result.append(mSum)


    print(f"#{t} {max(result)}")
728x90
(a, b) = input().split(' ')
a = int(a)
b = int(b)

print(a+b)
print(a-b)
print(a*b)
print(int(a/b))

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjsYKAMIDFAUq 

 

SW Expert Academy

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

swexpertacademy.com

 

728x90
T = int(input())
answer = []
for test_case in range(1, T + 1):
    result = 0

    data = list(map(int, input().split()))
    for i in range(len(data)):
        if(data[i] % 2 != 0):
            result += data[i]
    answer.append(result)

for i in range(len(answer)):
    print(f'#{i+1} {answer[i]}')

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QSEhaA5sDFAUq 

 

SW Expert Academy

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

swexpertacademy.com

 

728x90

+ Recent posts