看板 SeattleBest 關於我們 聯絡資訊
※ 引述《mimic0310 ( .)》之銘言: : ※ 引述《cowboy51 (我都知道......)》之銘言: : : 是c++喔 : : write a recursive function power (base,exponent)that,when invoked,returns : : base^exponent : : For example,power(3,4)=3*3*3*3.Assume that exponent is an integer greater than : : or equal to 1 : : Hint:THe recursion step would use relationship : : base^exponent=base*base^(exponent-1) : : and the terminating condition occurs whenexponent is equal to 1 because : : base^1=base : : 程式要怎模學啊 : : 像我都聽不懂 : 建議買本書來看吧... : 我覺得入門的書越白吃的越好啦...看的董最重要.... : 這題幾乎每本C++ 都會有範例吧...recursive的基本範例... : 要是最後一天還是寫不出來的話...賣摳莉會幫你的啦~^^~ 我絕得就是不斷的練習吧,你寫越多就會越來越熟練 也不要看別人的程式碼想說喔原來就是這樣,我都懂!! 其實自己寫又是另外一回事了... 不過我很爛(覺對沒有謙虛) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.94.139