-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.py
More file actions
36 lines (28 loc) ยท 854 Bytes
/
2.py
File metadata and controls
36 lines (28 loc) ยท 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ๋์ ํ์ด
n = int(input())
count = 0
def containThree(list):
for item in list:
for string in item:
for char in string:
if(char == "3"):
return 1
return 0
for i in range(n + 1):
for j in range(60):
for k in range(60):
times = [str(i), str(j), str(k)]
count += containThree(times)
print(count)
# ๋๋๋น๋ ํ์ด
# H๋ฅผ ์
๋ ฅ๋ฐ๊ธฐ
h = int(input())
count = 0
for i in range(h + 1):
for j in range(60):
for k in range(60):
# ๋งค ์๊ฐ ์์ '3'์ด ํฌํจ๋์ด ์๋ค๋ฉด ์นด์ดํธ ์ฆ๊ฐ
if '3' in str(i) + str(j) + str(k):
count += 1
print(count)
# ๋ฌธ์์ด์ ๋ํ ์ดํด๊ฐ ์์ง ๋ถ์กฑํ ๊ฒ ๊ฐ๊ณ , ์๊ฐ์ countํ ๋๋ +1์ ํด์ค์ผํ๋ค๋ ์ฌ์ค์ ์์ง ๋ง ๊ฒ!