源代码
文章平均质量分 60
fishorbird
白色的计算机程序员
展开
-
梵塔问题
#include int main() { void FT(int n,char a,char b,char c); int n; printf("请输入盘子的个数:"); scanf("%d",&n); printf("%d个盘子移动的步骤如下:\n",n); FT(n,'A','B','C'); return 0; } void FT(i原创 2015-10-21 14:22:25 · 8527 阅读 · 1 评论 -
四皇后问题
#include #include #define N 5// using namespace std; void Print(int n, int array[]){ for (int j = 1; j <= n; j++) cout<<array[j]<<" "; //输出最终的棋盘布局,每个数组元素值表示各行棋盘所在的该列放置皇后 cout<<endl<<endl; } bool is转载 2015-10-21 14:47:01 · 1375 阅读 · 0 评论