文件名称:about-indias-temple
介绍说明--下载内容均来自于网络,请自行研究使用
用于计算印度神庙的柱子问题,怎样子才能以最快速的方式算出其最优顺序。-#include stdio.h
#include stdlib.h
void move(char getone,char putone)
{
printf( c-> c\n ,getone,putone)
}
void hanoi(int n,char one,char two,char three)
{
if(n==1)
move(one,three)
else
{
hanoi(n-1,one,three,two)
move(one,three)
hanoi(n-1,two,one,three)
}
}
void main()
{
int m
printf( input the number of disks: )
scanf( d ,&m)
printf( the steps of moving 3d disks:\n ,m)
hanoi(m, A , B , C )
return 0
}
#include stdlib.h
void move(char getone,char putone)
{
printf( c-> c\n ,getone,putone)
}
void hanoi(int n,char one,char two,char three)
{
if(n==1)
move(one,three)
else
{
hanoi(n-1,one,three,two)
move(one,three)
hanoi(n-1,two,one,three)
}
}
void main()
{
int m
printf( input the number of disks: )
scanf( d ,&m)
printf( the steps of moving 3d disks:\n ,m)
hanoi(m, A , B , C )
return 0
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
about india's temple.exe