본문 바로가기
Algorithm

[구현/수학] 백준 21638 SMS from MCHS - 파이썬(Python)

by jangThang 2022. 10. 19.
반응형

백준 온라인 저지

 

[ Contents ]

     

     

    1. 문제 (링크 참조)

     

    21638번: SMS from MCHS

    The first line of input contains two integers $t_1$ and $v_1$ --- the temperature and the wind speed for today ($-50 \le t_1 \le 50$; $0 \le v_1 \le 20$). The second line contains two integers $t_2$ and $v_2$ --- the temperature and the wind speed for tomo

    www.acmicpc.net

     

     

     

    2. 문제 풀이

     오늘의 기온, 풍속과 함께, 내일의 기온, 풍속이 주어집니다. 

     

     

    3. 코드

    # 입력
    t1, v1 = map(int, input().split())
    t2, v2 = map(int, input().split())
    
    # 출력
    if t2 < 0 and v2 >= 10:
        print("A storm warning for tomorrow! Be careful and stay home if possible!")
    
    elif t2 < t1:
        print("MCHS warns! Low temperature is expected tomorrow.")
    
    elif v1 < v2:
        print("MCHS warns! Strong wind is expected tomorrow.")
    
    else:
        print("No message")

     

     

    star가 되고나서 Tistory

    반응형

    댓글