|
double duration;
time_t start, stop;
start = time(NULL);
printf("How many disk do you want?"); scanf("%d", &n);
hanoitower('A', 'B', 'C', n); /*A,B,C is the name of bars*/
stop = time(NULL);
duration = difftime(stop,start);
printf("\n\nTotal step is %d & duration is %d\n\n", count, duration);
return 0;
}
작년에 교양필수로 씨언어들어서 재밌길래..자료구조도 들었더니..참 어렵네요
도움말 색인을 찾아가며 했습니다만..실행시키면 항상 "duration is 0" 이 나오네요. clock도 써봤는데 굉장히 큰 (대략 11자리?)숫자가 나오고..뭔가 틀린부분이 있다면 지도 바랍니다..
|