하노이의 탑: 두 판 사이의 차이
내용 삭제됨 내용 추가됨
잔글 봇: 틀 이름 및 스타일 정리 |
change C code style |
||
57번째 줄:
#include <stdio.h>
void move(int from, int to)
{ printf("\nMove from %d to %d", from, to);
}
void hanoi(int n, int from, int by, int to)
{ if (n == 1)
move(from, to);
else
{
hanoi(n - 1, from, to, by);
move(from, to);
|