下列程序段A与B功能等价,请填写程序段B中相应语句。
程序段A:
Int f(int n) { if (n<= 1) return n; else return f (n-1)+f (n-2); } 程序B: Int f (int n) { 1; t0= 0 ; t1= 1 ; t= n; while2 { t=3; t0=t1; t1=t; n - -; } return4; }
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题