討論串[問題] 求倍數(使用遞迴)
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓3(3推 0噓 0→)留言3則,0人參與, 最新作者bleed1979時間15年前 (2011/03/30 23:56), 編輯資訊
0
0
0
內容預覽:
因為函數要傳回,那就修改一下,hard code小到大。. #include <iostream>. int main(int i, char* argc[]) {. if(i > 100) {. return 0;. }. int result = main(i + 1, argc);. if(i
(還有424個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者yauhh (喲)時間15年前 (2011/03/30 22:12), 編輯資訊
0
0
0
內容預覽:
要有一個結構或物件變數收集計算結果:. struct List { int head; struct List *tail; };. struct List* multiple(int from) {. struct List *result;. if (from > 100). return NU
(還有555個字)

推噓4(4推 0噓 4→)留言8則,0人參與, 最新作者qoo200033 (好時光)時間15年前 (2011/03/30 20:51), 編輯資訊
0
0
0
內容預覽:
問題:寫出一個可以計算1~100中是7的倍數的函式,若為7的倍數則傳回main()中印出. 程式碼. #include<stdio.h>. int multiple(int);. int main(void){. int result,i=1;. result=multiple(i);. print
(還有75個字)
首頁
上一頁
1
下一頁
尾頁