作者tim77928 (tim)
看板TransCSI
标题[问题] 99年彰师递回
时间Tue Jun 21 23:48:27 2011
given the following function, what is the value of Funny(4)
public static int Funny(int n){
if(n==1) return 1;
if(n==2) return 2;
else return Funny(n-1)+Funny(n-2)+3;
}
A.6 B.7 C.8 D.9 E.10
我算出来是11....是答案有错吗= =a还是我算错呢T^T
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.229.169.99
1F:推 stator:11 06/22 07:33
2F:推 TonyJih:11 = =...刚才耍笨了 06/22 11:09
3F:推 Pix911:8? 07/15 20:02
4F:→ Pix911:f4=f3+f2+3=f2+f1+3+f2+3=2+1+3+2+3=11 唉呀..我也耍笨了 07/15 20:04