N시 59분 59초 까지 3이 하나라도 나오는 경우의 수를 모두 구하는 문제
3
이 있으면 count를 증가hour, minute, second = 0, 0, 0
count = 0
while True:
if '3' in str(hour)+str(minute)+str(second):
count += 1
second += 1
if second == 60:
second = 0
minute += 1
if minute == 60:
minute = 0
hour += 1
if hour == n+1:
break
print(count)
h = int(input())
count = 0
for i in range(h+1): # hour
for j in range(60): # minute 0 ~ 59
for k in range(60): # second 0 ~ 59
if '3' in str(i) + str(j) + str(k):
count += 1
print(count)