1 2 3 4 5 6 7 8 9 10 11 12 #include < stdio.h > void hanoi_tower( int n, char from, char tmp, char to){ if (n > 0 ){ hanoi_tower(n - 1 , from, to, tmp); printf ( "원판 %d을 %c에서 %c으로 옮긴다.\n" ,n,from,to); hanoi_tower(n - 1 , tmp, from, to); } } main(){ hanoi_tower( 5 , 'A' , 'B' , 'C' ); } Colored by Color Scripter cs 실행화면
작성자가 댓글을 삭제했습니다.
답글삭제화이팅! 방학 잘 보내렴.
답글삭제