관리 메뉴

솜씨좋은장씨

[BaekJoon] 6749번 : Next in line (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 6749번 : Next in line (Python)

솜씨좋은장씨 2022. 5. 9. 11:55
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Next in line 입니다.

 

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

👨🏻‍💻 코드 ( Solution )

def next_in_line(youngest_age, middle_age):
    return 2 * middle_age - youngest_age


if __name__ == "__main__":
    youngest_age = int(input())
    middle_age = int(input())
    
    print(next_in_line(youngest_age, middle_age))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments