-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17478.py
More file actions
24 lines (19 loc) · 1.12 KB
/
17478.py
File metadata and controls
24 lines (19 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
def repeat(a, count):
print('____'*count+'"재귀함수가 뭔가요?"')
print('____'*count+'"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.')
print('____'*count+'마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.')
print('____'*count+'그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어."')
if a == 1:
count +=1
print('____'*count+'"재귀함수가 뭔가요?"')
print('____'*count+'"재귀함수는 자기 자신을 호출하는 함수라네"')
print('____'*count+'라고 답변하였지.')
while count != 0:
count -=1
print('____'*count+'라고 답변하였지.')
else:
repeat(a-1, count+1)
a= int(sys.stdin.readline().rstrip())
print('어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다.')
repeat(a, count = 0) #그냥 쉬운데 짜증나는 문제. 오타 _ 을 -로 입력해서 틀리고 빼먹은 구문있어서 그거만 잘 사펴보면 쉬움