| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- 2750
- 파이썬머신러닝완벽가이드
- 피보나치 수
- centuryFromYear
- Counting cells in a blob
- C++
- data_structure
- 2015 봄학기 알고리즘
- shapeArea
- 백준
- Sequential Search
- markdown
- Daily Commit
- adjacentElementsProduct
- 파이썬 포렌식
- 10953
- codesignal
- codesingal
- Python
- recursion
- 수 정렬하기
- cpp
- Numpy
- matrixElementsSum
- flask
- baekjun
- almostIncreasingSequence
- All Longest Strings
- til
- collections.deque
Archives
- Today
- Total
Introfor
하노이의 탑 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include<stdio.h> void hanoi(int n, int from, int by, int to){ if (n == 1) printf("\nMove from %d to %d", from, to); else{ hanoi(n - 1, from, to, by); printf("\nMove from %d to %d", from, to); hanoi(n - 1, by, from, to); } } int main(void){ int i = 3; hanoi(i, 1, 2, 3); return 0; } | cs |
'Doing > C&C++' 카테고리의 다른 글
| Russian Peasant Multiplication (0) | 2017.10.02 |
|---|---|
| 피보나치(반복, 재귀) (0) | 2017.09.18 |
| 팩토리얼(반복, 재귀) (0) | 2017.09.05 |
| 구조체 활용 (0) | 2017.05.25 |
| 구조체 활용 (0) | 2017.05.22 |
Comments