본문 바로가기
Algorithm

[구현/수학] 백준 14182 Tax - 파이썬(Python)

by jangThang 2023. 1. 27.
반응형

백준 온라인 저지

 

[ Contents ]

     

     

    1. 문제 (링크 참조)

     

    14182번: Tax

    The amount of income tax imposed on any taxpayer depends on his/her income. For an income less than or equal to 1,000,000 Oshloobs, no tax is paid. For an income greater than 1,000,000 and less than or equal to 5,000,000 Oshloobs, the tax is 10% of the inc

    www.acmicpc.net

     

     

     

    2. 문제 풀이

     문제에서 주어진 제약사항대로 조건문을 구현해서, 세금을 구합니다.

     

     

    3. 코드

    while True:
        t = int(input())
        if t == 0:
            break
    
        elif t <= 1000000:
            print(t)
    
        elif t <= 5000000:
            print(int(t * 0.9))
    
        else:
            print(int(t * 0.8))

     

     

    star가 되고나서 Tistory

    반응형

    댓글