728x90
6889번: Smile with Similes
A simile is a combination of an adjective and noun that produces a phrase such as "Easy as pie" or "Cold as ice". Write a program to input $n$ adjectives $(1 \le n \le 5)$ and $m$ nouns $(1 \le m \le 5)$, and print out all possible similes. The first two l
www.acmicpc.net
문제 풀이
이 문제는 입력값을 두 개의 리스트에 담아 각각의 조합을 출력해주는 문제이다.
정답 코드
n = int(input())
m = int(input())
lst1 = [input() for _ in range(n)]
lst2 = [input() for _ in range(m)]
for i in lst1 :
for j in lst2 :
print(i, "as", j)
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 6974 - Long Division [python] (0) | 2023.03.20 |
---|---|
[BOJ/백준] 6903 - Trident [python] (0) | 2023.03.19 |
[BOJ/백준] 6845 - Federal Voting Age [python] (0) | 2023.03.19 |
[BOJ/백준] 6830 - It’s Cold Here! [python] (0) | 2023.03.19 |
[BOJ/백준] 6812 - Good times [python] (0) | 2023.03.19 |