文件名称: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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.