#includeusing namespace std;int f(int n){int z;if(n==1)z=3;elsez=(n+2)*f(n-1);return z;}int main(){int x,y;x=4;y=f(x);cout<<"y="<
查看答案
#includeusing namespace std;int f(int n){int z;if(n>0)z=n*f(n-2);elsez=1;return z;}int main(){int x=7,y;y=f(x);cout<<"y="<
下面的程序是输出斐波那契数列的前20项。斐波那契数列的规律是:第一项等于1,第二项等于1,从第三项开始,每一项都等于前两项之和。#includeusing namespace std;int f(int n){int t;if(n==1||n==2)t=1;else①;return t;}int main(){int i;for(i=1;i<=20;i++){cout<
下列程序的功能是求s=1+2+3+......+n。#includeusing namespace std;intf(intn){intt;if(n==0)t=0;elseif(n==1)①;else②;returnt;}int main(){intn,s;cin>>n;s=③;cout<<"s="<
#includeusing namespace std;int f(int k){int i,t=1;for(i=1;i<=k;i++)t=t*i;return t;}int cmn(int m,int n){int s;s=① ;return s;}int main(){int m1,n1;for(m1=0;m1<7;m1++){for(n1=0;n1<=② ;n1++)cout<<③ <<'\t';cout<
A. f(m)/(f(n)*f(m-n))m1cmn(n1,m1)
B. f(m)/(f(n)*f(m-n))7cmn(m1,n1)
C. f(m)/(f(n)*f(m-n))m1cmn(m1,n1)
D. f(n)/(f(m)*f(n-m))m1cmn(m1,n1)