[问题] 99年彰师递回

楼主: tim77928 (tim)   2011-06-21 23:48:27
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
作者: stator (别急着吃棉花糖)   2011-06-22 07:33:00
11
作者: TonyJih (蠕动王)   2011-06-22 11:09:00
11 = =...刚才耍笨了
作者: Pix911 (Anis)   2011-07-15 20:02:00
8?f4=f3+f2+3=f2+f1+3+f2+3=2+1+3+2+3=11 唉呀..我也耍笨了

Links booklink

Contact Us: admin [ a t ] ucptt.com