728x90
반응형
단순 구현 문제이다.
for i in range(int(input())):
N = int(input())
for n in range(N, 0, -1):
if str(n) == "".join(sorted(list(str(n)))):
print(f"Case #{i+1}: {n}")
break
def check(n):
for i in range(len(n)-1):
if n[i] > n[i+1]:
return 0
return 1
for i in range(int(input())):
N = int(input())
for n in range(N, 0, -1):
if check(str(n)):
print(f"Case #{i+1}: {n}")
break
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 15232번 Rectangles(python) (0) | 2021.03.04 |
---|---|
백준 알고리즘 15036번 Just A Minim(python) (0) | 2021.03.04 |
백준 알고리즘 14920번 3n+1 수열(python) (0) | 2021.03.04 |
백준 알고리즘 14913번 등차수열에서 항 번호 찾기(python) (0) | 2021.03.04 |
백준 알고리즘 14909번 양수 개수 세기(python) (0) | 2021.03.04 |