首页 > 试题广场 >

下列程序段A与B功能等价,请填写程序段B中相应语句。

[填空题]

下列程序段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;
}

int t, t0, t1 n>1 t0+t1 t
发表于 2020-04-18 09:23:25 回复(0)