관리 메뉴

솜씨좋은장씨

[BaekJoon] 21612번 : Boiling Water (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 21612번 : Boiling Water (Python)

솜씨좋은장씨 2022. 11. 15. 12:20
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Boiling Water 입니다.

 

21612번: Boiling Water

At sea level, atmospheric pressure is 100 kPa and water begins to boil at 100◦C. As you go above sea level, atmospheric pressure decreases, and water boils at lower temperatures. As you go below sea level, atmospheric pressure increases, and water boils

www.acmicpc.net

🧑🏻‍💻 코드 ( Solution )

def get_atmospheric_pressure(B):
    return 5 * B - 400


def boiling_water(B):
    atmospheric_pressure = get_atmospheric_pressure(B=B)
    
    answer = 0
    
    if atmospheric_pressure > 100:
        answer = -1
    elif atmospheric_pressure < 100:
        answer = 1
        
    return atmospheric_pressure, answer


if __name__ == "__main__":
    B = int(input())
    atmospheric_pressure, answer = boiling_water(B=B)
    
    print(atmospheric_pressure)
    print(answer)
 

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