题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-04 04:28:06

[填空题]阅读下面程序: #include <iostream.h> long fib(int n) { if (n>2) return (fib(n-1) + fib(n-2)); else return (2); } void main( ) { cout<<fib(3)<<end1; } 则该程序的输出结果应该是 【12】

更多"阅读下面程序: #include <iostream.h> lon"的相关试题:

[填空题]阅读下面程序:
#include <iostream.h>
long fib(int n)

if (n>2)
return (fib(n-1)+fib(n-2));
else
return (2);

void main( )

cout<<fib(3)<<endl;

则该程序的输出结果应该是______。
[填空题]阅读下面程序:
#include <iostream.h>
long fib(int n)if (n>2)
return (fib(n-1) + fib(n-2));
else
return (2);void main( )cout<<fib(3)<<end1;则该程序的输出结果应该是 【12】
[简答题]读出下面程序的运行结果。
#include<stdio.h>
long fib(int n)

if(n>2)
return(fib(n-1)+fib(n-2));
else
return(2);

main( )

printf(“%d/n”,fib(6));

程序的运行结果是:
[填空题]以下程序的运行结果是 【8】 。 #include <stdio.h> long fib (int g) { switch (g) { case 0: return 0; case 1: case2: return 1; } return (fib(g-1)+fib(g-2)); } main( ) { long k; k=fib(5); printf("k=%d/n",k); }
[填空题]以下程序的运行结果是 【8】
#include <stdio.h>
long fib (int g)
switch (g)
case 0: return 0;
case 1: case2: return 1;

return (fib(g-1)+fib(g-2));

main( )
long k;
k=fib(5);
printf("k=%d/n",k);

[填空题]以下程序的运行结果是______。 #include <stdio.h> long fib(int g) { switch(g) { case 0:return 0; case 1: case 2:return 1;} return(fib(g-1) +fib(g-2));} main( ) { long k; k=fib(5); printf("k=%51d/n",k);}
[填空题]以下程序的运行结果是______。
#include <stdio.h>
long fib(int g)
switch(g)
case 0: return 0;
case 1:
case 2: return1;
return(fib(g-1)+fib(g-2));
main( )
long k;
k=fib(5);
printf("k=%5ld/n",k);
[填空题]以下程序的运行结果是______。 #include<stdio.h> long fib(int g) { switch(g) { case 0:return 0; case 1: case 2:return 1;} return(fib(g-1)+fib(g-2));} main( ) { long k; k=fib(5); printf("k=%51d/n",k);}
[简答题]#include
long fun(int n)
long s;
if(n<=2)s=2;
else s=n+fun(n-1);
printf("%d/t",s);
return s;

main( )

fun(5);
printf("/n");

[填空题]阅读下面程序:
#include <iostream.h>
int fun(int a,int b)

int t;
c=a*b:
return c;

void main( )

int a=3,b=5,c=4,x=0;
x=fun(fun(a,b),c);
cout<<x<<endl;

其运行结果是______。
[填空题]阅读下面程序:
#include <iostream.h>
int fun( int a, int b )int c;
c=a*b;
return c;void main( )int a=3,b=5,c=4,x=0;
x=fun(fun(a, b),c);
cout<<x<<end1;其运行结果是 【9】
[填空题]阅读下面程序: #include <iostream.h> int fun( int a, int b ) { int c; c=a*b; return c; } void main( ) { int a=3,b=5,c=4,x=0; x=fun(fun(a, b),c); cout<<x<<end1; } 其运行结果是 【9】
[填空题]阅读下面程序:
#include <iostream.h>
int fun2(int m)

if(m%3==0)
return 1;
else
return 0;

void fun1(int m, int &s)

int i;
for (i=1; i<m; i++)
if(fun2(i))
S=S*i;

void main( )

int n=9, s=2;
fun1(n, s);
cout<<s<<end1;

该程序的运行结果是 【12】
[单项选择]阅读下面程序,则程序段的功能是
#include"stdio.h"
main( )
int c[]=23,1,56,234,7,0,34,i,j,t;
for(i=1;i<7;i++)
t=c[i];j=i-1;
while(j>=0 && t>c[j])
c[j+1]=c[j];j--;
c[j+1]=t;
for(i=0;i<7;i++)
printf("%d",c[i]);
putchar(’/n’);
A. 对数组元素的升序排列
B. 对数组元素的降序排列
C. 对数组元素的倒序排列
D. 对数组元素的随机排列

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码