소개글
씨언어로 하노이 타워를 구현한 것입니다.
시간을 재는 내용도 포함되어 있구요...
목차
없음
본문내용
*/
#include<stdio.h>
#include<conio.h>
#include<time.h>
void tower(int, int, int, int);
int move; //number of move
int count;
clock_t start,stop;
double duration;
void main()
{
int n; //number of disk
printf("\nEnter the number of disks: ");
scanf("%d",&n);
printf("****시작****\n");
start=clock();
tower(n, 1, 2, 3);
stop=clock();
printf("\n****멈춤****\n ");
duration = ((double)(stop-start))/CLK_TCK;
printf("\nmove number: %d\n",move);
printf("duration:%f(sec)\n",duration);
참고 자료
없음