Python으로 구현한 6749번 수강변경 문제 풀이입니다.
https://www.acmicpc.net/problem/6749
6749번: Next in line
You know a family with three children. Their ages form an arithmetic sequence: the difference in ages between the middle child and youngest child is the same as the difference in ages between the oldest child and the middle child. For example, their ages c
www.acmicpc.net
y = int(input())
m = int(input())
print(m + (m-y))
1. 가장 어린 나이(y)와 중간 나이(m)는 입력으로 주어지고, 가장 많은 나이를 출력해야하므로 단순히 m과 y의 차이를 m에 더하여 출력한다.
'백준(Python) 풀이 > 수학' 카테고리의 다른 글
백준(Python) 4375번 1 풀이 (0) | 2022.01.18 |
---|---|
백준(Python) 22193번 Multiply 풀이 (0) | 2022.01.03 |
백준(Python) 11104번 Fridge of Your Dreams 풀이 (0) | 2021.11.14 |
백준(Python) 13985번 Equality 풀이 (0) | 2021.11.14 |
백준(Python) 12756번 고급 여관 풀이 (0) | 2021.11.14 |