[백준] 1526번 : 가장 큰 금민수 - Python(파이썬)

강재원·2022년 10월 18일
0

[코딩테스트] Python

목록 보기
121/200



https://www.acmicpc.net/problem/1526

n=input()
while 1:
    c=0
    for i in range(len(n)):
        if n[i]!='4' and n[i]!='7':
            c=1
            break
    if c==0:
        break
    else:
        n=str(int(n)-1)
print(n)
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글