-Code
m = int(input())
n = int(input())
cnt = 0
for i in range(1, m + 1):
for j in range(1, n + 1):
if i + j == 10:
cnt += 1
if cnt == 1:
print("There is 1 way to get the sum 10.")
else:
print(f"There are {cnt} ways to get the sum 10.")
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 5246번 Checkerboard Rows (0) | 2025.02.07 |
---|---|
[백준/파이썬] 9622번 Cabin Baggage (0) | 2025.02.05 |
[백준/파이썬] 9945번 Centroid of Point Masses (0) | 2025.02.04 |
[백준/파이썬] 1213번 팰린드롬 만들기 (0) | 2025.02.03 |
[백준/파이썬] 6162번 Superlatives (0) | 2025.02.02 |