漢羅塔問題

C語言複習——漢羅塔問題 ①先理解一下最典型的遞歸問題:求n的階乘 { int jc(int n); int n,y; printf("請輸入n的值:"); scanf("%d",&n); y=jc(n); printf("%d!=%d",n,y); } int jc(int n) { int r; if(n == 0||n== 1) r=1; else r=n*jc(n-1
相關文章
相關標籤/搜索