题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-22 13:34:32

[填空题]阅读下面程序:
#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"的相关试题:

[填空题]阅读下面程序:
#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 int fun(int (*S)[4],int n,int k) { int m,i; m=s[0][k]; for(i=1;im)m=s[i][k]; return m; } main( ) {int a[4][4]={{1,2,3,4},{11,12,13,14},{21,22,23,24},{3l,32,33,34}}; printf("%d/n",fun(a,4,0)); } 程序的运行结果是
A. 4
B. 34
C. 31
D. 32
[填空题]阅读下面程序:
#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
int fun(int n, int *p)
int f1, f2;
if(n==1||n==2) *p=1;
else
fun(n-1, &f1); fun(n-2, &f2);
*p=f1+f2;
main( )
int s;
fun(3, &s); printf("%d/n", s);程序的运行结果是()。
A. 2
B. 3
C. 4
D.  5
[单项选择]

有以下程序
  #include
  int fun( )
  { static int x=1;
  x*2; return x;
  }
  main( )
  {int i,s=1,
  for(i=1;i<=2;i++) s=fun( );
  printf("%d/n",s);
  }
  程序运行后的输出结果是()


A. 0
B. 1
C. 4
D. 8
[填空题]有以下程序 #include int fun(int n) { if(n == 0) return(1); return(fun(n - 1) * n); } main( ) { int t; t = fun(3); printf("%d/n", t); }程序运行后输出结果是 [14]
[填空题]

以下程序运行时输出到屏幕的结果是() 。
#include
int fun(int x)
{static int c,y;
if(c==0) y=1;
else y=y+x;
c++;
return y;
}
void main( )
{int i;
for(i=0;i<2;i++)
printf("%d",fun(2));
}


[填空题]以下程序运行时输出到屏幕的结果是【10】。 #include int fun(int *x,int n) {if(n==0) return x[0]; else return x[0]+fun(x+1,n-1); } void main( ) {int a[ ]={1,2,3,4,5,6,7}; printf("%d/n",fun(a,2));
[填空题]

[程序]
#include
int fun(char *s)
{
char *p=s;
while(*p) p++;
return(p-s);
}
void main(void)
{
char s1[]={"China"},s2[]={"Apple/nPear/tCat/0Bye"};
cout<
cout<
}
执行以上程序后输出的第一行是 () ,第二行是 () 。


[简答题]

#include
int fun(int m)
{
static int n=l;++m;++n;
return(m+n);
}
void main( ) {
int a,b;a=fun(0);b=fun(10);
printf("a=%d,b=%d\n",a,b);
}


[单项选择]阅读下面程序:
#include<iostream.h>
fun(int a,int b)

int c;
c=a+b;
return c;

void main( )

int x=6,y=7,z=8,r;
r=fun((x--,y++,x+y),z--);
cout<<r<<end1;

则该程序的输出结果是( )。
A. 11
B. 20
C. 21
D. 31
[单项选择]下面程序的运行结果是 #include<iostream.h> int fun(int a[ ] ,int n) { int result=1; for(int i=1;i<n;i++) result=result * a[i] ; retum result; } void main( ) { int a[3] ={3,4,5}; cout < < fun(a,3) < < endl; } A) 12 B) 15 C) 20 D) 60
[填空题]

以下程序运行时输出结果中第一行是(),第二行是()
#include
int fun(char *a,char *b)
{int m=0,n=0:
while(*(a+m)!=’/0’)m++;
while(b[n])
{ *(a+m)=b[n];m++;n++; }
*(a+m)=’/0’;
return m;
}
void main( )
{char s1[20]="yes",s2[5]="no";
printf("%d/n",fun(s1,s2));
puts(s1);
}


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

int x(5);
static int y(10);
if(n>0)

++x;
++y;
cout<<x<<","<<y<<end1;


void main( )

int m(1);
fun(m);

则该程序的输出结果是______。

我来回答:

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

订单号:

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