Programming_prob/BaekJoon
[백준] 1065번 한수
YongArtist
2020. 10. 5. 05:10
파이썬 문법에서 함수와 조건문, 반복문, 리스트에 대한 개념만 알면 풀 수 있는 쉬운 문제
1
2
3
4
5
6
7
8
9
10
11
12
13
|
def solve():
n = int(input())
cnt = 0
if n < 100: return n
for i in range(100, n + 1):
nums = list(map(int, str(i)))
if nums[1] - nums[0] == nums[2] - nums[1]:
cnt += 1
return cnt + 99
res = solve()
print(res)
|
cs |