→ walume:沒有傳回值..那要怎麼傳..?@@"140.128.194.155 05/18
Function Power(Base As Integer, Exponent As Integer)
If Exponent = 0 Then
Power = 1
Else
Power = Base * Power(Base, Exponent - 1)
End If
End Function
這是你的,你沒有傳回值,結果當然是零啦。
至於公因數嘛,實在沒辦法...
我學 vb 的時候鮮少見到遞迴的範例,所以不太會寫遞迴/.\
想了半天想不出個流程來:~~
--
VB 程式設計 倉木麻衣 PTT 星爺板 行列輸入法
======================================================
Visual_Basic MaiKuraki Stephen Array
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.222.155.162