일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- matrixElementsSum
- baekjun
- til
- 피보나치 수
- collections.deque
- codesignal
- Python
- shapeArea
- Numpy
- recursion
- 백준
- cpp
- C++
- All Longest Strings
- flask
- 파이썬 포렌식
- 10953
- Counting cells in a blob
- Daily Commit
- markdown
- 2015 봄학기 알고리즘
- Sequential Search
- adjacentElementsProduct
- 2750
- 수 정렬하기
- data_structure
- almostIncreasingSequence
- codesingal
- 파이썬머신러닝완벽가이드
- centuryFromYear
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