热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_41429382
百态·数智思维
3 年前
trueweixin_41429382

要追着这个星球上最好的数学家学数学,数学可以替换成为任意 一门你热爱的学科,然后按这句话说的去努力做就好了。——陈省身先生

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
#include<stdio.h>int main(){ void hanoi(int a,char one,char two,char three); int m; printf("input the number of disks:"); scanf("%d",&m); printf("the step to move %d disks:\n",m); hanoi(m,'A','B','C'); return 0;} void hanoi(int a, char one, char two, char three){ void move(char x,char y); if (a == 1) move(one, three); else { hanoi(a - 1, one, three, two); move(one, three); hanoi(a - 1, two, one, three); }}void move(char x, char y){ printf("%c->%c\n", x, y);}
立即登录