forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.cpp
More file actions
15 lines (12 loc) · 437 Bytes
/
4.cpp
File metadata and controls
15 lines (12 loc) · 437 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <bits/stdc++.h>
using namespace std;
void recursiveFunction(int i) {
// 100번째 호출을 했을 때 종료되도록 종료 조건 명시
if (i == 100) return;
cout << i << "번째 재귀 함수에서 " << i + 1 << "번째 재귀함수를 호출합니다." << '\n';
recursiveFunction(i + 1);
cout << i << "번째 재귀 함수를 종료합니다." << '\n';
}
int main(void) {
recursiveFunction(1);
}