递归
yonuyeung
武汉科技大学
展开
-
汉诺塔-课本例题
#include<iostream> using namespace std; void move(int n,char from,char buf,char to) { if(n==1) printf("%c-->%c\n",from,to); else { move(n-1,from,to,buf); printf("%c-->%c\n",from,to); move(n-1,buf,fr.原创 2021-12-22 22:41:42 · 306 阅读 · 0 评论 -
2013 蟠桃记(杭电)
// // main.c // 杭州电子科技大学 // // Created by yonuyeung on 2021/10/12. // #include<stdio.h> int calculation(); int main(){ int n; while(scanf("%d",&n)!=EOF) { printf("%d\n",calculation(n)); } return 0; } int calculati.原创 2021-10-16 11:28:12 · 60 阅读 · 0 评论