반응형

[ Contents ]
1. 문제 (링크 참조)
16017번: Telemarketer or not?
Here at the Concerned Citizens of Commerce (CCC), we have noted that telemarketers like to use seven-digit phone numbers where the last four digits have three properties. Looking just at the last four digits, these properties are: the first of these four d
www.acmicpc.net
2. 문제 풀이
전화번호 뒷 4자리가 주어집니다. 1번째와 4번째 숫자가 8 또는 9이고, 2번째와 3번째 숫자가 같으면 '텔레마케터'의 전화입니다. 스팸 전화는 무시하고, 아닐 경우 받아야 합니다.
3. 코드
# 입력
a = input()
b = input()
c = input()
d = input()
# 판별
if (b == c) and (a == '8' or a == '9') and (d == '8' or d == '9'):
print("ignore")
else:
print("answer")

반응형
'Algorithm' 카테고리의 다른 글
| [DP/동적계획법] 백준 14495 피보나치 비스무리한 수열 - 파이썬(Python) (0) | 2022.08.31 |
|---|---|
| [DP/동적계획법] 백준 1788 피보나치 수의 확장 - 파이썬(Python) (0) | 2022.08.30 |
| [구현/수학] 백준 20976 2 番目に大きい整数 (The Second Largest Integer) - 파이썬(Python) (0) | 2022.08.28 |
| [DP/동적계획법] 백준 13699 점화식 - 파이썬(Python) (0) | 2022.08.27 |
| [구현/수학] 백준 18330 Petrol - 파이썬(Python) (0) | 2022.08.26 |
댓글